with-label.tsx 652 B

123456789101112131415161718192021222324
  1. import type { FC } from 'react'
  2. import type { DividerProps } from '.'
  3. import Divider from '.'
  4. import classNames from '@/utils/classnames'
  5. export type DividerWithLabelProps = DividerProps & {
  6. label: string
  7. }
  8. export const DividerWithLabel: FC<DividerWithLabelProps> = (props) => {
  9. const { label, className, ...rest } = props
  10. return <div
  11. className="flex items-center gap-2 my-2"
  12. >
  13. <Divider {...rest} className={classNames('flex-1', className)} />
  14. <span className="text-text-tertiary text-xs">
  15. {label}
  16. </span>
  17. <Divider {...rest} className={classNames('flex-1', className)} />
  18. </div>
  19. }
  20. export default DividerWithLabel