import React from 'react'; import { InlineNotification } from '@carbon/react'; import { useTranslation } from 'react-i18next'; import InPatientNote, { InPatientNoteSkeleton } from './note.component'; import { type PatientNote } from '../types'; import styles from './styles.scss'; interface PatientNotesHistoryProps { patientNotes: Array; mutatePatientNotes: () => void; isLoading: boolean; errorFetchingPatientNotes: Error; promptBeforeClosing(hasUnsavedChanges: boolean): void; } const PatientNotesHistory: React.FC = ({ patientNotes, mutatePatientNotes, isLoading, errorFetchingPatientNotes, promptBeforeClosing, }) => { const { t } = useTranslation(); if (!isLoading && patientNotes.length === 0 && !errorFetchingPatientNotes) return null; return (
History
{isLoading ? [1, 2, 3, 4].map((item, index) => ) : null} {patientNotes.map((patientNote) => ( ))} {errorFetchingPatientNotes && ( )}
); }; export default PatientNotesHistory;