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

const OPTION_AGAMA = [
    { label: '1 : ISLAM', value: '1' },
    { label: '2 : KRISTEN PROTESTAN', value: '2' },
    { label: '3 : KATOLIK', value: '3' },
    { label: '4 : HINDU', value: '4' },
    { label: '5 : BUDHA', value: '5' },
    { label: '6 : KONGHUCU', value: '6' },
    { label: '9 : LAINNYA', value: '9' },
];

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

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