Hook-Nest/src/components/ui/FormSelect.jsx
2025-10-06 22:54:41 +05:30

23 lines
659 B
JavaScript

'use client';
export default function FormSelect({ label, value, onChange, options, placeholder }) {
return (
<div>
<label className="block text-sm font-medium text-gray-700 mb-1">
{label}
</label>
<select
value={value}
onChange={(e) => onChange(e.target.value)}
className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-teal-500"
>
<option value="">{placeholder}</option>
{options.map((option) => (
<option key={option} value={option}>
{option}
</option>
))}
</select>
</div>
);
}