import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Select } from "../../../components/atoms/Select";
import { Label } from "../../../components/atoms/Label";
import { Text } from "../../../components/atoms/Text";
export const SelectField = ({ label, name, value, onChange, options, placeholder, required = false, error, className = "", }) => {
    const selectOptions = placeholder
        ? [{ value: "", label: placeholder }, ...options]
        : options;
    return (_jsxs("div", { className: `mb-4 ${className}`, children: [_jsx(Label, { htmlFor: name, required: required, error: !!error, children: label }), _jsx(Select, { id: name, name: name, value: value, onChange: onChange, options: selectOptions, error: error }), error && (_jsx(Text, { variant: "small", className: "text-error-500 mt-1", children: error }))] }));
};
export default SelectField;
