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

const OPTION_STATUS = [
    { label: 'Aktif', value: '1' },
    { label: 'Non Aktif', value: '0' },
];

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

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