import React, { useState } from 'react'; import { Button, Search, TabPanel } from '@carbon/react'; import { useTranslation } from 'react-i18next'; import { PatientSearchPictogram } from '@openmrs/esm-framework'; import PrescriptionsTable from './prescriptions-table.component'; import styles from './patient-search-tab-panel.scss'; import { type SimpleLocation } from '../types'; interface PatientSearchTabPanelProps { locations: Array; } const PatientSearchTabPanel: React.FC = ({ locations }) => { const { t } = useTranslation(); const [searchTerm, setSearchTerm] = useState(''); const [submittedSearchTerm, setSubmittedSearchTerm] = useState(''); return (
{ e.preventDefault(); setSubmittedSearchTerm(searchTerm); }}> { setSearchTerm(e.target.value); }} onClear={() => setSubmittedSearchTerm('')} size="lg" /> {submittedSearchTerm ? ( ) : (
{t('searchForPatientHeader', 'Search for a patient')}
{t('searchForPatient', 'Search for a patient by name or identifier number')}
)}
); }; export default PatientSearchTabPanel;