with-label.tsx 652 B

1234567891011121314151617181920212223
  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="my-2 flex items-center gap-2"
  12. >
  13. <Divider {...rest} className={classNames('flex-1', className)} />
  14. <span className="text-xs text-text-tertiary">
  15. {label}
  16. </span>
  17. <Divider {...rest} className={classNames('flex-1', className)} />
  18. </div>
  19. }
  20. export default DividerWithLabel