'use client'
import { forwardRef, SelectHTMLAttributes, OptionHTMLAttributes } from 'react'
import { cn } from '@/utils/helpers'
export interface SelectProps extends SelectHTMLAttributes {
label?: string
error?: string
options: { value: string; label: string }[]
placeholder?: string
}
export const Select = forwardRef(
({ className, label, error, options, placeholder, id, ...props }, ref) => {
const selectId = id || label?.toLowerCase().replace(/\s+/g, '-')
return (
{label && (
)}
{error && (
{error}
)}
)
}
)
Select.displayName = 'Select'