feat: add onGetData callback to TableList and enhance DetailSparepart with improved image handling
This commit is contained in:
@@ -22,6 +22,7 @@ const TableList = memo(function TableList({
|
||||
columnDynamic = false,
|
||||
cardComponent, // New prop for custom card component
|
||||
onStockUpdate, // Prop to pass to card component
|
||||
onGetData, // Callback to execute when data is received
|
||||
}) {
|
||||
const [gridLoading, setGridLoading] = useState(false);
|
||||
|
||||
@@ -105,7 +106,14 @@ const TableList = memo(function TableList({
|
||||
setColumnsDynamic([...defaultColumns, ...numericColumns]);
|
||||
}
|
||||
|
||||
setData(resData?.data ?? []);
|
||||
const fetchedData = resData?.data ?? [];
|
||||
|
||||
// Panggil callback jika disediakan
|
||||
if (onGetData && typeof onGetData === 'function') {
|
||||
onGetData(fetchedData);
|
||||
}
|
||||
|
||||
setData(fetchedData);
|
||||
|
||||
const pagingData = resData?.paging;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user