Download src/components/AppComponent.tsx from medajd/sf-bbf: direct link, hf CLI and curl.
- Browser
- Download file 823 Bytes
-
https://huggingface.co/spaces/medajd/sf-bbf/resolve/main/src/components/AppComponent.tsx
- Command line
-
hf download hf://spaces/medajd/sf-bbf/src/components/AppComponent.tsx
-
curl -L -o AppComponent.tsx https://huggingface.co/spaces/medajd/sf-bbf/resolve/main/src/components/AppComponent.tsx
823 Bytes
| import React from 'react'; | |
| import { useSelector, useDispatch } from 'react-redux'; | |
| import { Title } from './Title'; | |
| import { Text } from './Text'; | |
| import { Button } from './Button'; | |
| const AppComponent: React.FC = () => { | |
| const title = useSelector((state: ApplicationState) => state.Reducer1.title); | |
| const text = useSelector((state: ApplicationState) => state.Reducer1.text); | |
| const button = useSelector((state: ApplicationState) => state.Reducer1.button); | |
| const dispatch = useDispatch(); | |
| return ( | |
| <div> | |
| <Title title={title} /> | |
| <div> | |
| {text.map((paragraph) => ( | |
| <Text key={paragraph} text={paragraph} /> | |
| ))} | |
| </div> | |
| <Button onClick={() => dispatch({ type: 'button_1', text: button })}> | |
| {button} | |
| </Button> | |
| </div> | |
| ); | |
| }; | |
| export default AppComponent; |