"use client"; import React, { SelectHTMLAttributes } from "react"; import { cn } from "@/app/utils/functions"; interface SelectOption { value: string; label: string; } interface SelectProps extends SelectHTMLAttributes { options: SelectOption[]; placeholder?: string; className?: string; parentClassName?: string; style?: React.CSSProperties; label?: string; hasError?: boolean; errorMessage?: string; darkTheme?: boolean; htmlFor?: string; } const Select = ({ options, placeholder = "Select an option", className = "", parentClassName, value, style, label, hasError = false, errorMessage, darkTheme = false, htmlFor, ...props }: SelectProps) => { const defaultTheme = "text-[var(--color-secondary-800)] ring-[var(--color-secondary-200)] disabled:bg-[var(--color-secondary-200)] disabled:text-[var(--color-secondary-400)] disabled:ring-[var(--color-secondary-300)]"; return ( {label && ( {label} )} {placeholder} {options.map((option) => ( {option.label} ))} {/* Custom dropdown arrow */} {errorMessage && ( {errorMessage} )} ); }; export default Select; export type { SelectOption, SelectProps };