import React from 'react'; import { useTranslation } from 'react-i18next'; import { SelectItem } from '@carbon/react'; interface SelectLocationProps { selectedLocation: string; defaultFacility: { uuid: string; display: string; }; locations?: Array; } interface LocationOptions { uuid?: string; display?: string; } const LocationSelectOption: React.FC = ({ selectedLocation, defaultFacility, locations }) => { const { t } = useTranslation(); if (!selectedLocation) { return ; } if (defaultFacility && Object.keys(defaultFacility).length !== 0) { return ( {defaultFacility?.display} ); } if (locations && locations.length > 0) { return ( <> {locations.map((location) => ( {location.display} ))} ); } return null; }; export default LocationSelectOption;