import { __ } from '@wordpress/i18n' import classNames from 'classnames' import { ReactComponent as AnyAvailableIcon } from '../../../../public/images/icon-any-available.svg' import { ReactComponent as CheckIcon } from '../../../../public/images/icon-checkmark-staff.svg' import { IStaffOption, IStaffSelectorProps } from './types' import './StaffSelector.scss' import { useWording } from '../../hooks/useWording' export const STAFF_ANY_AVAILABLE = '0' export const StaffSelector = ({ staffOptions, selectedStaffId, onSelect, treatNullAsAnyAvailable = true, }: IStaffSelectorProps) => { const isAnyAvailableSelected = (id: string | null) => id === STAFF_ANY_AVAILABLE || (treatNullAsAnyAvailable && id === null) const wording = useWording() return (