index.tsx 751 B

123456789101112131415161718192021222324252627282930313233
  1. import type { CSSProperties, FC } from 'react'
  2. import React from 'react'
  3. import { type VariantProps, cva } from 'class-variance-authority'
  4. import classNames from '@/utils/classnames'
  5. const dividerVariants = cva(
  6. 'bg-divider-regular',
  7. {
  8. variants: {
  9. type: {
  10. horizontal: 'w-full h-[0.5px] my-2',
  11. vertical: 'w-[1px] h-full mx-2',
  12. },
  13. },
  14. defaultVariants: {
  15. type: 'horizontal',
  16. },
  17. },
  18. )
  19. type DividerProps = {
  20. className?: string
  21. style?: CSSProperties
  22. } & VariantProps<typeof dividerVariants>
  23. const Divider: FC<DividerProps> = ({ type, className = '', style }) => {
  24. return (
  25. <div className={classNames(dividerVariants({ type }), className)} style={style}></div>
  26. )
  27. }
  28. export default Divider