import React, { Fragment } from 'react'; import { StyledSelectOption } from './style'; import { useTheme } from '@emotion/react'; import { capitalize } from '../../functions'; import { BnIcon, Checkbox } from '..'; import { Typography } from '../../atoms'; import { ETypography, ETypographyColor, Icons } from '../../types/theme'; type Option = { label: string; value: string | number | Date; icon?: Icons; }; export interface ISelectOptions { options: Option[]; onSelect: (val: unknown) => void; value?: string | string[] | number[] | Date[]; isMultiple?: boolean; autoFocus?: boolean; } export const SelectOptions = ({ options, onSelect, value = [], autoFocus = true, isMultiple = false, }: ISelectOptions) => { const colors = useTheme(); const newValue = Array.isArray(value) ? value : value ? [value] : []; return (