From 0ff0f14ecf7356ce9af257b832aae0a7886b2e2f Mon Sep 17 00:00:00 2001 From: sophia-massie Date: Thu, 3 Oct 2024 18:25:25 -0500 Subject: [PATCH] - Addresses Type 'ReactNode' is not assignable to type 'NonNullable' error in unit test --- react/src/components/utils/EmptyTablePlaceholder.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/react/src/components/utils/EmptyTablePlaceholder.tsx b/react/src/components/utils/EmptyTablePlaceholder.tsx index e2c61420..63fc8f24 100644 --- a/react/src/components/utils/EmptyTablePlaceholder.tsx +++ b/react/src/components/utils/EmptyTablePlaceholder.tsx @@ -2,18 +2,21 @@ import { SectionMessage } from '../../core-components'; import styles from './EmptyTablePlaceholder.module.css'; import React from 'react'; + interface EmptyPlaceholderProps { - children: React.ReactNode; - type: 'error' | 'warning' | 'info' | 'success'; + children?: React.ReactNode; + type: 'error' | 'warning' | 'info' | 'success'; } export const EmptyTablePlaceholder: React.FC = ({ children, - type, + type, }) => { return (
- {children} + {children ? ( + {children} + ) : No data available.}
); };