import { Select } from './Select';
import { ReactSelectProps } from '@/types';

const OPTION_STATUS_MARITAL = [
    { label: '1 : BELUM MENIKAH', value: '1' },
    { label: '2 : MENIKAH', value: '2' },
    { label: '3 : CERAI HIDUP', value: '3' },
    { label: '4 : CERAI MATI', value: '4' },
];

export const SelectStatusMarital = (props: ReactSelectProps) => {

    return (
        <Select
            value={OPTION_STATUS_MARITAL?.find((item: { label: string; value: string }) => item.value == props.value) ?? ''}
            isDisabled={props.disable}
            options={OPTION_STATUS_MARITAL}
            placeholder="Status Marital"
            onChange={(newValue: unknown) => {
                const option = newValue as { label: string; value: string };
                props.onChange?.(option?.value);
            }}
        />
    );
};
