Download tabler-react/src/components/Stamp/Stamp.react.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 612 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/tabler-react/src/components/Stamp/Stamp.react.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/tabler-react/src/components/Stamp/Stamp.react.js
-
curl -L -o Stamp.react.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/tabler-react/src/components/Stamp/Stamp.react.js
612 Bytes
| // @flow | |
| import * as React from "react"; | |
| import cn from "classnames"; | |
| import { Icon } from "../"; | |
| type Props = {| | |
| +children?: React.Node, | |
| +className?: string, | |
| +size?: "sm" | "md", | |
| +icon?: string, | |
| +color?: string, | |
| |}; | |
| function Stamp({ | |
| children, | |
| className, | |
| size = "md", | |
| icon, | |
| color = "", | |
| }: Props): React.Node { | |
| const classes = cn( | |
| { stamp: true, [`stamp-${size}`]: size, [`bg-${color}`]: color }, | |
| className | |
| ); | |
| return ( | |
| <span className={classes}> | |
| {icon && <Icon name={icon} />} | |
| {children} | |
| </span> | |
| ); | |
| } | |
| Stamp.displayName = "Stamp"; | |
| export default Stamp; | |