Fix : build error
This commit is contained in:
@@ -4,15 +4,8 @@ import React, { useEffect, useState } from "react";
|
|||||||
import { Center, Group, Loader, Paper, ScrollArea, Table, Text, Title } from "@mantine/core";
|
import { Center, Group, Loader, Paper, ScrollArea, Table, Text, Title } from "@mantine/core";
|
||||||
import { notifications } from "@mantine/notifications";
|
import { notifications } from "@mantine/notifications";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import Image, { StaticImageData } from "next/image";
|
import Image from "next/image";
|
||||||
import BOI from '@/app/image/bank_logo/BOI.jpg';
|
import { getBankLogo } from "@/app/_util/getBankLogo";
|
||||||
import hdfc from '@/app/image/bank_logo/hdfc.jpg';
|
|
||||||
import sbi from '@/app/image/bank_logo/sbi.jpg';
|
|
||||||
import icici from '@/app/image/bank_logo/icici.jpg'
|
|
||||||
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";
|
import { IconTrash } from "@tabler/icons-react";
|
||||||
|
|
||||||
interface Beneficiary {
|
interface Beneficiary {
|
||||||
@@ -24,32 +17,6 @@ interface Beneficiary {
|
|||||||
branchName: string;
|
branchName: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
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() {
|
export default function ViewBeneficiary() {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [authorized, setAuthorized] = useState<boolean | null>(null);
|
const [authorized, setAuthorized] = useState<boolean | null>(null);
|
||||||
@@ -116,7 +83,7 @@ export default function ViewBeneficiary() {
|
|||||||
<Table.Th>Name</Table.Th>
|
<Table.Th>Name</Table.Th>
|
||||||
<Table.Th>Type</Table.Th>
|
<Table.Th>Type</Table.Th>
|
||||||
<Table.Th style={{ textAlign: "center" }}>IFSC</Table.Th>
|
<Table.Th style={{ textAlign: "center" }}>IFSC</Table.Th>
|
||||||
<Table.Th style={{ textAlign: "center" }}>Action Icon</Table.Th>
|
<Table.Th style={{ textAlign: "center" }}>Action Icon</Table.Th>
|
||||||
</Table.Tr>
|
</Table.Tr>
|
||||||
</Table.Thead>
|
</Table.Thead>
|
||||||
<Table.Tbody>
|
<Table.Tbody>
|
||||||
@@ -125,7 +92,8 @@ export default function ViewBeneficiary() {
|
|||||||
<Table.Td>
|
<Table.Td>
|
||||||
<Group gap='sm'>
|
<Group gap='sm'>
|
||||||
<Image
|
<Image
|
||||||
src={getBankLogo(b.bankName) ??logo}
|
// src={getBankLogo(b.bankName) ??logo}
|
||||||
|
src={getBankLogo(b.bankName)}
|
||||||
alt={b.bankName}
|
alt={b.bankName}
|
||||||
width={20}
|
width={20}
|
||||||
height={15}
|
height={15}
|
||||||
@@ -137,7 +105,7 @@ export default function ViewBeneficiary() {
|
|||||||
<Table.Td>{b.name}</Table.Td>
|
<Table.Td>{b.name}</Table.Td>
|
||||||
<Table.Td>{b.accountType}</Table.Td>
|
<Table.Td>{b.accountType}</Table.Td>
|
||||||
<Table.Td style={{ textAlign: "center" }}>{b.ifscCode}</Table.Td>
|
<Table.Td style={{ textAlign: "center" }}>{b.ifscCode}</Table.Td>
|
||||||
<Table.Td style={{ textAlign: "center" }}><IconTrash color="red"/></Table.Td>
|
<Table.Td style={{ textAlign: "center" }}><IconTrash color="red" /></Table.Td>
|
||||||
</Table.Tr>
|
</Table.Tr>
|
||||||
))}
|
))}
|
||||||
</Table.Tbody>
|
</Table.Tbody>
|
||||||
|
@@ -97,7 +97,7 @@ export default function ChangePassword() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ✅ Passed → move to OTP step
|
// Passed → move to OTP step
|
||||||
setStep("otp");
|
setStep("otp");
|
||||||
notifications.show({
|
notifications.show({
|
||||||
title: "OTP Sent",
|
title: "OTP Sent",
|
||||||
|
23
src/app/_util/getBankLogo.ts
Normal file
23
src/app/_util/getBankLogo.ts
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import { StaticImageData } from "next/image";
|
||||||
|
import BOI from "@/app/image/bank_logo/BOI.jpg";
|
||||||
|
import hdfc from "@/app/image/bank_logo/hdfc.jpg";
|
||||||
|
import sbi from "@/app/image/bank_logo/sbi.jpg";
|
||||||
|
import icici from "@/app/image/bank_logo/icici.jpg";
|
||||||
|
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";
|
||||||
|
|
||||||
|
export function getBankLogo(bankName: string): StaticImageData {
|
||||||
|
const logos: Record<string, StaticImageData> = {
|
||||||
|
"STATE BANK": sbi,
|
||||||
|
"PUNJAB NATIONAL": pnb,
|
||||||
|
"HDFC": hdfc,
|
||||||
|
"ICICI": icici,
|
||||||
|
"AXIS": axis,
|
||||||
|
"BANK OF INDIA": BOI,
|
||||||
|
"KANGRA": kccb,
|
||||||
|
};
|
||||||
|
|
||||||
|
return logos[bankName.toUpperCase()] ?? logo;
|
||||||
|
}
|
Reference in New Issue
Block a user