diff --git a/src/views/apps/account/AccountListTable.tsx b/src/views/apps/account/AccountListTable.tsx index 24b14a6..0df4835 100644 --- a/src/views/apps/account/AccountListTable.tsx +++ b/src/views/apps/account/AccountListTable.tsx @@ -65,7 +65,7 @@ type AccountTypeWithAction = AccountType & { } // Dummy Account Data -const accountsData: AccountType[] = [ +export const accountsData: AccountType[] = [ { id: 1, code: '1-10001', diff --git a/src/views/apps/cash-bank/CashBankList.tsx b/src/views/apps/cash-bank/CashBankList.tsx index 85c5517..92aa8f5 100644 --- a/src/views/apps/cash-bank/CashBankList.tsx +++ b/src/views/apps/cash-bank/CashBankList.tsx @@ -16,6 +16,9 @@ import CustomTextField from '@/@core/components/mui/TextField' import { getLocalizedUrl } from '@/utils/i18n' import { Locale } from '@/configs/i18n' import { useParams } from 'next/navigation' +import AccountFormDrawer, { AccountType } from '../account/AccountFormDrawer' +import { accountsData } from '../account/AccountListTable' +import { Button } from '@mui/material' // Types interface BankAccount { @@ -250,10 +253,15 @@ const DebouncedInput = ({ } const CashBankList = () => { const [searchQuery, setSearchQuery] = useState('') + const [editingAccount, setEditingAccount] = useState(null) + const [addAccountOpen, setAddAccountOpen] = useState(false) + const [data, setData] = useState(accountsData) const { lang: locale } = useParams() - // Handle button clicks - const handleAccountAction = () => {} + const handleCloseDrawer = () => { + setAddAccountOpen(false) + setEditingAccount(null) + } // Filter and search logic const filteredAccounts = useMemo(() => { @@ -267,60 +275,80 @@ const CashBankList = () => { }, [searchQuery]) return ( - - {/* Search and Filters */} - - - + <> + + {/* Search and Filters */} + +
setSearchQuery(value as string)} placeholder='Cari ' className='max-sm:is-full' /> - + + + +
+
+ + {/* Account Cards */} + + {filteredAccounts.length > 0 ? ( + filteredAccounts.map(account => ( + + + + )) + ) : ( + + + + Tidak ada akun yang ditemukan + + + Coba ubah kata kunci pencarian atau filter yang digunakan + + + + )}
- - {/* Account Cards */} - - {filteredAccounts.length > 0 ? ( - filteredAccounts.map(account => ( - - - - )) - ) : ( - - - - Tidak ada akun yang ditemukan - - - Coba ubah kata kunci pencarian atau filter yang digunakan - - - - )} - -
+ + ) }