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 { notifications } from "@mantine/notifications";
|
||||
import { useRouter } from "next/navigation";
|
||||
import Image, { 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';
|
||||
import Image from "next/image";
|
||||
import { getBankLogo } from "@/app/_util/getBankLogo";
|
||||
import { IconTrash } from "@tabler/icons-react";
|
||||
|
||||
interface Beneficiary {
|
||||
@@ -24,32 +17,6 @@ interface Beneficiary {
|
||||
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() {
|
||||
const router = useRouter();
|
||||
const [authorized, setAuthorized] = useState<boolean | null>(null);
|
||||
@@ -116,7 +83,7 @@ export default function ViewBeneficiary() {
|
||||
<Table.Th>Name</Table.Th>
|
||||
<Table.Th>Type</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.Thead>
|
||||
<Table.Tbody>
|
||||
@@ -125,7 +92,8 @@ export default function ViewBeneficiary() {
|
||||
<Table.Td>
|
||||
<Group gap='sm'>
|
||||
<Image
|
||||
src={getBankLogo(b.bankName) ??logo}
|
||||
// src={getBankLogo(b.bankName) ??logo}
|
||||
src={getBankLogo(b.bankName)}
|
||||
alt={b.bankName}
|
||||
width={20}
|
||||
height={15}
|
||||
@@ -137,7 +105,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 style={{ textAlign: "center" }}><IconTrash color="red"/></Table.Td>
|
||||
<Table.Td style={{ textAlign: "center" }}><IconTrash color="red" /></Table.Td>
|
||||
</Table.Tr>
|
||||
))}
|
||||
</Table.Tbody>
|
||||
|
@@ -97,7 +97,7 @@ export default function ChangePassword() {
|
||||
return;
|
||||
}
|
||||
|
||||
// ✅ Passed → move to OTP step
|
||||
// Passed → move to OTP step
|
||||
setStep("otp");
|
||||
notifications.show({
|
||||
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