From 66bdb6afe10d7bd672ca9a75500f94305c7330ac Mon Sep 17 00:00:00 2001 From: RohitR311 Date: Sat, 28 Dec 2024 19:11:13 +0530 Subject: [PATCH] feat: display message if list fields is empty --- src/components/organisms/RightSidePanel.tsx | 112 ++++++++++---------- 1 file changed, 58 insertions(+), 54 deletions(-) diff --git a/src/components/organisms/RightSidePanel.tsx b/src/components/organisms/RightSidePanel.tsx index 12f75028..b09964e6 100644 --- a/src/components/organisms/RightSidePanel.tsx +++ b/src/components/organisms/RightSidePanel.tsx @@ -545,60 +545,64 @@ export const RightSidePanel: React.FC = ({ onFinishCapture )} {step.type === 'list' && ( - <> - {t('right_panel.messages.list_selected')} - {Object.entries(step.fields).map(([key, field]) => ( - - handleTextLabelChange(field.id, e.target.value, step.id, key)} - fullWidth - margin="normal" - InputProps={{ - readOnly: confirmedListTextFields[field.id]?.[key], - startAdornment: ( - - - - ) - }} - /> - - - - ) - }} - /> - {!confirmedListTextFields[step.id]?.[key] && ( - - - - - )} - - ))} - + Object.entries(step.fields).length === 0 ? ( + {t('right_panel.messages.list_empty')} + ) : ( + <> + {t('right_panel.messages.list_selected')} + {Object.entries(step.fields).map(([key, field]) => ( + + handleTextLabelChange(field.id, e.target.value, step.id, key)} + fullWidth + margin="normal" + InputProps={{ + readOnly: confirmedListTextFields[field.id]?.[key], + startAdornment: ( + + + + ) + }} + /> + + + + ) + }} + /> + {!confirmedListTextFields[step.id]?.[key] && ( + + + + + )} + + ))} + + ) )} ))}