Download tabler-react/src/components/PricingCard/PricingCardAttributeItem.react.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 794 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/tabler-react/src/components/PricingCard/PricingCardAttributeItem.react.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/tabler-react/src/components/PricingCard/PricingCardAttributeItem.react.js
-
curl -L -o PricingCardAttributeItem.react.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/tabler-react/src/components/PricingCard/PricingCardAttributeItem.react.js
794 Bytes
| // @flow | |
| import * as React from "react"; | |
| import cn from "classnames"; | |
| import Icon from "../Icon"; | |
| // TODO: Add RootComponent prop | |
| type Props = {| | |
| +children?: React.Node, | |
| +available?: boolean, | |
| +hasIcon?: boolean, | |
| |}; | |
| function PricingCardAttributeItem({ | |
| children, | |
| available, | |
| hasIcon, | |
| }: Props): React.Node { | |
| const iconClasses = available | |
| ? cn("text-success", "mr-2") | |
| : cn("text-danger", "mr-2"); | |
| return hasIcon ? ( | |
| <li> | |
| {" "} | |
| <Icon | |
| prefix="fe" | |
| name={available ? "check" : "x"} | |
| className={iconClasses} | |
| isAriaHidden | |
| /> | |
| {children} | |
| </li> | |
| ) : ( | |
| <li> {children} </li> | |
| ); | |
| } | |
| PricingCardAttributeItem.displayName = "PricingCard.AttributeItem"; | |
| /** @component */ | |
| export default PricingCardAttributeItem; | |