import { type FC } from 'react'

import { clx } from '@/helpers/utils'

type DividerProps = {
    label?: string
    className?: string
    lineClassName?: string
    labelClassName?: string
}

const Divider: FC<DividerProps> = ({ label, className, lineClassName, labelClassName }) => {
    return (
        <div className={clx('flex items-center gap-4', className)}>
            <span className={clx('flex-1 border-t border-dashed border-neutral-200', lineClassName)} />
            {label ? (
                <span className={clx('text-xs text-neutral-500', labelClassName)}>
                    {label}
                </span>
            ) : null}
            <span className={clx('flex-1 border-t border-dashed border-neutral-200', lineClassName)} />
        </div>
    )
}

export default Divider

