Download tabler-react/src/forms/FormCard.react.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 890 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/tabler-react/src/forms/FormCard.react.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/tabler-react/src/forms/FormCard.react.js
-
curl -L -o FormCard.react.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/tabler-react/src/forms/FormCard.react.js
890 Bytes
| // @flow | |
| import * as React from "react"; | |
| import Form from "../components/Form"; | |
| import Card from "../components/Card"; | |
| import Button from "../components/Button"; | |
| type Props = {| | |
| +action?: string, | |
| +children?: React.Node, | |
| +method?: string, | |
| +title: string, | |
| +buttonText: string, | |
| +onSubmit?: Function, | |
| |}; | |
| function FormCard({ | |
| children, | |
| action, | |
| method, | |
| onSubmit, | |
| title, | |
| buttonText, | |
| }: Props): React.Node { | |
| return ( | |
| <Form className="card" onSubmit={onSubmit} action={action} method={method}> | |
| <Card.Body className="p-6"> | |
| <Card.Title RootComponent="div">{title}</Card.Title> | |
| {children} | |
| <Form.Footer> | |
| <Button type="submit" color="primary" block={true}> | |
| {buttonText} | |
| </Button> | |
| </Form.Footer> | |
| </Card.Body> | |
| </Form> | |
| ); | |
| } | |
| export default FormCard; | |