mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-24 15:25:46 +00:00
refactor(FE): Show kandangs table for add-request and selection
This commit is contained in:
@@ -174,9 +174,16 @@ const ExpenseKandangsTable = ({
|
|||||||
updateSortingFilter('picSort', picSortFilter);
|
updateSortingFilter('picSort', picSortFilter);
|
||||||
}, [sorting, updateSortingFilter]);
|
}, [sorting, updateSortingFilter]);
|
||||||
|
|
||||||
|
// Tampilkan tabel jika:
|
||||||
|
// 1. Mode request pertama kali (type='add' dan formType='request')
|
||||||
|
// 2. Atau sudah ada kandang yang dipilih
|
||||||
|
const shouldShowTable =
|
||||||
|
(type === 'add' && formType === 'request') ||
|
||||||
|
(selectedKandangs.length > 0 && selectedKandangs.some((k) => k.id));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{selectedKandangs.length > 0 && selectedKandangs.some((k) => k.id) && (
|
{shouldShowTable && (
|
||||||
<Card
|
<Card
|
||||||
className={{
|
className={{
|
||||||
wrapper: className?.wrapper,
|
wrapper: className?.wrapper,
|
||||||
|
|||||||
Reference in New Issue
Block a user