refactor: unified transaction url.
feat: modify admin pages.
This commit is contained in:
@@ -13,6 +13,7 @@ import pnb from '@/app/image/bank_logo/pnb.jpg'
|
||||
import axis from '@/app/image/bank_logo/axis.jpg'
|
||||
import kccb from '@/app/image/bank_logo/kccb.jpg'
|
||||
import logo from '@/app/image/bank_logo/bank.jpg';
|
||||
import { IconTrash } from "@tabler/icons-react";
|
||||
|
||||
interface Beneficiary {
|
||||
accountNo: string;
|
||||
@@ -23,15 +24,31 @@ interface Beneficiary {
|
||||
branchName: string;
|
||||
}
|
||||
|
||||
const bankLogo: Record<string, StaticImageData> = {
|
||||
"BANK OF INDIA": BOI,
|
||||
"HDFC BANK LTD": hdfc,
|
||||
"STATE BANK OF INDIA": sbi,
|
||||
"ICICI BANK LTD": icici,
|
||||
"PUNJAB NATIONAL BANK": pnb,
|
||||
"AXIS BANK": axis,
|
||||
"THE KANGRA CENTRAL CO-OP BANK LIMITED": kccb
|
||||
}
|
||||
export const getBankLogo = (bankName: string): StaticImageData | undefined => {
|
||||
const name = bankName.toUpperCase();
|
||||
if (name.includes("STATE BANK")) {
|
||||
return sbi;
|
||||
}
|
||||
if (name.includes("PUNJAB NATIONAL")) {
|
||||
return pnb;
|
||||
}
|
||||
if (name.includes("HDFC")) {
|
||||
return hdfc;
|
||||
}
|
||||
if (name.includes("ICICI")) {
|
||||
return icici;
|
||||
}
|
||||
if (name.includes("AXIS")) {
|
||||
return axis;
|
||||
}
|
||||
if (name.includes("BANK OF INDIA")) {
|
||||
return BOI;
|
||||
}
|
||||
if (name.includes("KANGRA")) {
|
||||
return kccb;
|
||||
}
|
||||
return undefined; // fallback
|
||||
};
|
||||
|
||||
export default function ViewBeneficiary() {
|
||||
const router = useRouter();
|
||||
@@ -95,11 +112,11 @@ export default function ViewBeneficiary() {
|
||||
<Table.Thead>
|
||||
<Table.Tr style={{ backgroundColor: "#3385ff" }}>
|
||||
<Table.Th>Bank</Table.Th>
|
||||
<Table.Th>Account No</Table.Th>
|
||||
<Table.Th style={{ textAlign: "right" }}>Account No</Table.Th>
|
||||
<Table.Th>Name</Table.Th>
|
||||
<Table.Th>Type</Table.Th>
|
||||
<Table.Th>IFSC</Table.Th>
|
||||
{/* <Table.Th>Branch</Table.Th> */}
|
||||
<Table.Th style={{ textAlign: "center" }}>IFSC</Table.Th>
|
||||
<Table.Th style={{ textAlign: "center" }}>Action Icon</Table.Th>
|
||||
</Table.Tr>
|
||||
</Table.Thead>
|
||||
<Table.Tbody>
|
||||
@@ -108,7 +125,7 @@ export default function ViewBeneficiary() {
|
||||
<Table.Td>
|
||||
<Group gap='sm'>
|
||||
<Image
|
||||
src={bankLogo[b.bankName] || logo}
|
||||
src={getBankLogo(b.bankName) ??logo}
|
||||
alt={b.bankName}
|
||||
width={20}
|
||||
height={15}
|
||||
@@ -120,7 +137,7 @@ export default function ViewBeneficiary() {
|
||||
<Table.Td>{b.name}</Table.Td>
|
||||
<Table.Td>{b.accountType}</Table.Td>
|
||||
<Table.Td style={{ textAlign: "center" }}>{b.ifscCode}</Table.Td>
|
||||
{/* <Table.Td>{b.branchName}</Table.Td> */}
|
||||
<Table.Td style={{ textAlign: "center" }}><IconTrash color="red"/></Table.Td>
|
||||
</Table.Tr>
|
||||
))}
|
||||
</Table.Tbody>
|
||||
|
Reference in New Issue
Block a user