Skip to content

Commit 01891dd

Browse files
4manasamanasa
andauthored
fixed the localization issue (#459)
* fixed the localization issue * lint fix --------- Co-authored-by: manasa <[email protected]>
1 parent a82d3ed commit 01891dd

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/react-sdk-components/src/components/template/SimpleTable/SimpleTableManual/SimpleTableManual.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
146146
const [displayDialogDateFilter, setDisplayDialogDateFilter] = useState<string>('notequal');
147147
const [displayDialogDateValue, setDisplayDialogDateValue] = useState<string>('');
148148
const selectedRowIndex: any = useRef(null);
149-
149+
const localizedVal = PCore.getLocaleUtils().getLocaleValue;
150+
const localeCategory = 'SimpleTable';
150151
const parameters = fieldMetadata?.datasource?.parameters;
151152
const { referenceListStr } = getContext(getPConnect());
152153
const label = labelProp || propertyLabel;
@@ -708,7 +709,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
708709
})}
709710
</TableBody>
710711
</Table>
711-
{rowData && rowData.length === 0 && (
712+
{((readOnlyMode && (!rowData || rowData?.length === 0)) || (editableMode && (!referenceList || referenceList?.length === 0))) && (
712713
<div className='no-records' id='no-records'>
713714
No records found.
714715
</div>
@@ -717,7 +718,7 @@ export default function SimpleTableManual(props: PropsWithChildren<SimpleTableMa
717718
{showAddRowButton && (
718719
<div style={{ fontSize: '1rem' }}>
719720
<Link style={{ cursor: 'pointer' }} onClick={addRecord} underline='hover'>
720-
+ Add
721+
+ {localizedVal('Add', localeCategory)}
721722
</Link>
722723
</div>
723724
)}

0 commit comments

Comments
 (0)