Download ant-design/components/float-button/FloatButtonContent.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 871 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/ant-design/components/float-button/FloatButtonContent.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@f5071caa249115f3b590492f1c8eb471e02aae4b/ant-design/components/float-button/FloatButtonContent.tsx
-
curl -L -o FloatButtonContent.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/f5071caa249115f3b590492f1c8eb471e02aae4b/ant-design/components/float-button/FloatButtonContent.tsx
871 Bytes
| import React, { memo } from 'react'; | |
| import FileTextOutlined from '@ant-design/icons/FileTextOutlined'; | |
| import classNames from 'classnames'; | |
| import type { FloatButtonContentProps } from './interface'; | |
| const FloatButtonContent: React.FC<FloatButtonContentProps> = (props) => { | |
| const { icon, description, prefixCls, className, ...rest } = props; | |
| const defaultElement = ( | |
| <div className={`${prefixCls}-icon`}> | |
| <FileTextOutlined /> | |
| </div> | |
| ); | |
| return ( | |
| <div {...rest} className={classNames(className, `${prefixCls}-content`)}> | |
| {icon || description ? ( | |
| <> | |
| {icon && <div className={`${prefixCls}-icon`}>{icon}</div>} | |
| {description && <div className={`${prefixCls}-description`}>{description}</div>} | |
| </> | |
| ) : ( | |
| defaultElement | |
| )} | |
| </div> | |
| ); | |
| }; | |
| export default memo(FloatButtonContent); | |