feat: api integration for account tab

fix: layout design
feat : add screen for account tab
This commit is contained in:
2025-07-13 19:21:53 +05:30
parent 1023646751
commit 26e6dea82b
7 changed files with 442 additions and 266 deletions

View File

@@ -12,7 +12,7 @@ interface accountData {
custname: string;
}
export default function SavingsAccount() {
export default function AccountSummary() {
const router = useRouter();
const [authorized, setAuthorized] = useState<boolean | null>(null);
const [accountData, setAccountData] = useState<accountData[]>([]);
@@ -30,6 +30,7 @@ export default function SavingsAccount() {
const data = await response.json();
if (response.ok && Array.isArray(data)) {
setAccountData(data);
sessionStorage.setItem('accountData',JSON.stringify(data))
}
} catch {
notifications.show({
@@ -67,7 +68,9 @@ export default function SavingsAccount() {
<tr key={index}>
<td style={{ ...cellStyle, textAlign: "left" }}>{acc.custname}</td>
<td style={{ ...cellStyle, textAlign: "left" }}>{acc.stAccountType}</td>
<td style={{ ...cellStyle, textAlign: "right" }}>{acc.stAccountNo}</td>
<td style={{ ...cellStyle, textAlign: "right", color: '#1c7ed6', cursor: "pointer" }}
onClick={() => router.push(`/accounts/account_statement?accNo=${acc.stAccountNo}`)}>
{acc.stAccountNo}</td>
<td style={{ ...cellStyle, textAlign: "right" }}>
{parseFloat(acc.stAvailableBalance).toLocaleString("en-IN", {
minimumFractionDigits: 2,