"use client";
import React, { useState } from "react";
import {
Text,
Title,
Box,
Image,
Card,
Checkbox,
Button,
Group,
Grid,
Container,
ActionIcon,
Divider,
} from "@mantine/core";
import { Providers } from "@/app/providers";
import { useRouter } from "next/navigation";
import NextImage from "next/image";
import logo from "@/app/image/logo1.jpg";
import { IconLogout } from "@tabler/icons-react";
type Mandate = {
id: string;
category: string;
amount: number;
maxAmount: number;
name: string;
frequency: string;
firstCollection: string;
finalCollection: string;
};
const MandateCard = ({
mandate,
onAccept,
onReject,
}: {
mandate: Mandate;
onAccept: (id: string) => void;
onReject: (id: string) => void;
}) => {
const [agreed, setAgreed] = useState(false);
return (
{mandate.category}
Amount: ₹{mandate.amount}
Max Amount: ₹{mandate.maxAmount}
Name: {mandate.name}
Frequency: {mandate.frequency}
First Collection: {mandate.firstCollection}
Final Collection: {mandate.finalCollection}
setAgreed(e.currentTarget.checked)}
/>
);
};
export default function MandatePage() {
const router = useRouter();
const [mandates] = useState([
{
id: "1",
category: "Insurance Premium",
amount: 11743,
maxAmount: 11743,
name: "LIFE INSURANCE CORPORATION",
frequency: "YEAR",
firstCollection: "2025-09-20",
finalCollection: "2038-03-28",
},
{
id: "2",
category: "Loan EMI",
amount: 8500,
maxAmount: 8500,
name: "XYZ BANK",
frequency: "MONTH",
firstCollection: "2025-10-01",
finalCollection: "2030-10-01",
},
]);
const handleAccept = (id: string) => {
alert(`Accepted mandate ${id}`);
};
const handleReject = (id: string) => {
alert(`Rejected mandate ${id}`);
};
const handleLogout = () => {
localStorage.removeItem("access_token");
router.push("/eMandate/login"); // redirect to login page
};
return (
{/* HEADER */}
THE KANGRA CENTRAL CO-OPERATIVE BANK LTD.
{/* Logout Icon */}
{/* WELCOME BAR */}
Welcome, John Doe
Login Time: 9/24/2025, 12:52:05 PM
KCCB E-Mandate
{/* CONTENT */}
{mandates.map((mandate) => (
))}
{/* FOOTER */}
© 2025 The Kangra Central Co-Operative Bank
);
}