diff --git a/public/svg/add.svg b/public/svg/add.svg
new file mode 100644
index 0000000..ae9028f
--- /dev/null
+++ b/public/svg/add.svg
@@ -0,0 +1,7 @@
+
+
+
\ No newline at end of file
diff --git a/public/svg/filter.svg b/public/svg/filter.svg
new file mode 100644
index 0000000..288df85
--- /dev/null
+++ b/public/svg/filter.svg
@@ -0,0 +1,7 @@
+
+
+
\ No newline at end of file
diff --git a/public/svg/question.svg b/public/svg/question.svg
new file mode 100644
index 0000000..7a11239
--- /dev/null
+++ b/public/svg/question.svg
@@ -0,0 +1,7 @@
+
+
+
\ No newline at end of file
diff --git a/public/svg/view.svg b/public/svg/view.svg
new file mode 100644
index 0000000..acb9f0e
--- /dev/null
+++ b/public/svg/view.svg
@@ -0,0 +1,7 @@
+
+
+
\ No newline at end of file
diff --git a/src/app/admin-dashboard/components/AdminDashboardHeader.tsx b/src/app/admin-dashboard/components/AdminDashboardHeader.tsx
index 096e8f9..d57ff33 100644
--- a/src/app/admin-dashboard/components/AdminDashboardHeader.tsx
+++ b/src/app/admin-dashboard/components/AdminDashboardHeader.tsx
@@ -1,10 +1,19 @@
-import React from "react";
+"use client";
+
+import React, { useEffect, useState } from "react";
import Notification from "../../../../public/svg/notification.svg";
import Avatar from "../../../../public/svg/Avatar.svg";
import { MdOutlineKeyboardArrowDown } from "react-icons/md";
import { Menu, Plus } from "lucide-react";
import Image from "next/image";
-import { useRouter } from "next/router";
+import { usePathname } from "next/navigation";
+
+const navItems = [
+ { href: "/admin-dashboard", label: "Dashboard" },
+ { href: "/admin-dashboard/plans", label: "Inheritance Plans" },
+ { href: "/admin-dashboard/claims", label: "Claims" },
+ { href: "/admin-dashboard/support", label: "Support" },
+];
export default function AdminDashboardHeader({
sidebarOpen,
@@ -13,17 +22,25 @@ export default function AdminDashboardHeader({
sidebarOpen: boolean;
setSidebarOpen: any;
}) {
+ const pathname = usePathname();
+ const [currentPage, setCurrentPage] = useState("Dashboard");
+
+ useEffect(() => {
+ const matchedPage =
+ navItems.find((item) => pathname === item.href)?.label || "Dashboard";
+ setCurrentPage(matchedPage);
+ }, [pathname]);
return (
- Dashboard
+ {currentPage}
-
+
@@ -35,14 +52,15 @@ export default function AdminDashboardHeader({
className="rounded-full"
alt="Avatar"
/>
-
- Not Connected
-
+
Not Connected
-
diff --git a/src/app/admin-dashboard/components/SupportAddQuestion.tsx b/src/app/admin-dashboard/components/SupportAddQuestion.tsx
new file mode 100644
index 0000000..6078a61
--- /dev/null
+++ b/src/app/admin-dashboard/components/SupportAddQuestion.tsx
@@ -0,0 +1,95 @@
+"use client";
+
+import { useState, useEffect } from "react";
+import { CheckCircle } from "lucide-react";
+
+interface AddQuestionModalProps {
+ isOpen: boolean;
+ setIsOpen: (value: boolean) => void;
+}
+
+export default function AddQuestionModal({ isOpen, setIsOpen }: AddQuestionModalProps) {
+ const [isAddingQuestion, setIsAddingQuestion] = useState(true);
+ const [isConfirmationVisible, setIsConfirmationVisible] = useState(false);
+
+ useEffect(() => {
+ const handleKeyDown = (event: KeyboardEvent) => {
+ if (event.key === "Escape") setIsOpen(false);
+ };
+ document.addEventListener("keydown", handleKeyDown);
+ return () => document.removeEventListener("keydown", handleKeyDown);
+ }, [setIsOpen]);
+
+ if (!isOpen) return null;
+
+ const handleApplyChanges = () => {
+ setIsAddingQuestion(false);
+ setIsConfirmationVisible(true);
+
+ setTimeout(() => {
+ setIsOpen(false);
+ setIsAddingQuestion(true);
+ setIsConfirmationVisible(false);
+ }, 15000);
+ };
+
+ return (
+
+
+
+
setIsOpen(false)} className="text-gray-400 text-xl hover:text-white">
+ ← Go Back
+
+
+ {isAddingQuestion ? (
+ <>
+
Add Question
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Apply Changes
+
+ >
+ ) : isConfirmationVisible ? (
+
+
+
Question Added
+
+ Question Added Sucessfully
+
+
setIsOpen(false)}
+ className="mt-4 bg-white text-black px-10 py-2 rounded-2xl hover:bg-zinc-300"
+ >
+ Close
+
+
+ ) : null}
+
+
+ );
+}
diff --git a/src/app/admin-dashboard/components/SupportEditQuestion.tsx b/src/app/admin-dashboard/components/SupportEditQuestion.tsx
new file mode 100644
index 0000000..e942626
--- /dev/null
+++ b/src/app/admin-dashboard/components/SupportEditQuestion.tsx
@@ -0,0 +1,102 @@
+"use client";
+
+import { useEffect, useState } from "react";
+import { CheckCircle } from "lucide-react";
+
+interface QuestionData {
+ question: string;
+ answer: string;
+ category: string;
+}
+
+interface SupportEditQuestionProps {
+ isOpen: boolean;
+ setIsOpen: (value: boolean) => void;
+ questionData?: QuestionData;
+}
+
+export default function SupportEditQuestion({ isOpen, setIsOpen, questionData }: SupportEditQuestionProps) {
+ const [question, setQuestion] = useState(questionData?.question || "");
+ const [answer, setAnswer] = useState(questionData?.answer || "");
+ const [category, setCategory] = useState(questionData?.category || "");
+ const [isSuccess, setIsSuccess] = useState(false);
+
+ useEffect(() => {
+ if (questionData) {
+ setQuestion(questionData.question);
+ setAnswer(questionData.answer);
+ setCategory(questionData.category);
+ }
+ }, [questionData]);
+
+ const handleApplyChanges = () => {
+ setIsSuccess(true);
+
+ setTimeout(() => {
+ setIsOpen(false);
+ setIsSuccess(false);
+ }, 10000);
+ };
+
+ if (!isOpen) return null;
+
+ return (
+
+
+ {isSuccess ? (
+
+
+
Changes Saved
+
Question Edited successfully.
+
setIsOpen(false)}
+ className="mt-4 bg-white text-black px-10 py-2 rounded-2xl hover:bg-zinc-300"
+ >
+ Close
+
+
+ ) : (
+ <>
+
setIsOpen(false)} className="text-white mb-4 text-xl">
+ ← Go Back
+
+
Edit Question
+
+
+
setQuestion(e.target.value)}
+ className="w-full p-2 rounded-xl bg-[#21202A] border border-[#D9D9DD] text-white mb-4 outline-none"
+ />
+
+
+
+
+
+
+
+ );
+}
diff --git a/src/app/admin-dashboard/components/SupportFaqs.tsx b/src/app/admin-dashboard/components/SupportFaqs.tsx
new file mode 100644
index 0000000..b17a292
--- /dev/null
+++ b/src/app/admin-dashboard/components/SupportFaqs.tsx
@@ -0,0 +1,110 @@
+"use client";
+
+import Image from "next/image";
+import { useState } from "react";
+import { ChevronDown } from "lucide-react";
+import SupportAddQuestion from "../components/SupportAddQuestion";
+import SupportEditQuestion from "../components/SupportEditQuestion";
+
+interface FAQ {
+ question: string;
+ answer: string;
+ category: string;
+}
+
+export default function SupportFaqs() {
+ const [isAddOpen, setIsAddOpen] = useState(false);
+ const [isEditOpen, setIsEditOpen] = useState(false);
+ const [selectedQuestion, setSelectedQuestion] = useState(undefined);
+
+
+ const faqs: FAQ[] = [
+ {
+ question: "How Secure is the Platform?",
+ answer: `InheritX ensures top-tier security with multi-signature validation, time-locked smart contracts, and zero-knowledge proofs for privacy. We conduct regular third-party audits, support hardware wallet integration, and use advanced encryption to protect users' assets.`,
+ category: "Security",
+ },
+ {
+ question: "What makes InheritX different from traditional inheritance platforms?",
+ answer: `InheritX leverages blockchain technology to ensure automated execution of inheritance plans through smart contracts, eliminating the need for intermediaries while maintaining decentralized security. Our platform provides transparent verification of inheritance conditions, enabling beneficiaries to access assets with complete trust. Additionally, immutable record-keeping ensures that all transactions and inheritance plans remain tamper-proof and permanently verifiable on the blockchain.`,
+ category: "Security",
+ },
+ ];
+
+ const handleEditClick = (faq: FAQ) => {
+ setSelectedQuestion(faq);
+ setIsEditOpen(true);
+ };
+
+ return (
+
+
+
setIsAddOpen(true)}
+ className="flex items-center gap-2 bg-[#1B0055] hover:bg-[#2D1B50] px-6 py-3 border border-[#C0BFC6] rounded-full transition-colors"
+ >
+ Add Question
+
+
+
+
+
+ Security
+
+
+
+
+
+ {isEditOpen && (
+
+ )}
+
+
+
+
+
+
+
+
+ | Question |
+ Answer |
+ Category |
+ Action |
+
+
+
+ {faqs.map((faq, index) => (
+
+ | {faq.question} |
+ {faq.answer} |
+ {faq.category} |
+
+ handleEditClick(faq)}
+ className="text-[#6D2BFF] hover:text-[#6e2bffc9]"
+ >
+ Edit
+
+
+ Delete
+
+ |
+
+ ))}
+
+
+
+
+
+ );
+}
diff --git a/src/app/admin-dashboard/components/SupportQuickAction.tsx b/src/app/admin-dashboard/components/SupportQuickAction.tsx
new file mode 100644
index 0000000..ee3aeb9
--- /dev/null
+++ b/src/app/admin-dashboard/components/SupportQuickAction.tsx
@@ -0,0 +1,40 @@
+import React from "react";
+import Image from "next/image";
+
+
+const SupportQuickAction = () => {
+
+ interface Button {
+ icon: string;
+ label: string;
+ }
+
+ const buttons: Button[] = [
+ { icon: "/svg/add.svg", label: "Add FAQ" },
+ { icon: "/svg/view.svg", label: "View All FAQs" },
+ ];
+
+ return (
+
+
Quick Actions
+
+ {buttons.map((button, index) => (
+
+
+ {button.label}
+
+ ))}
+
+
+ );
+ }
+
+export default SupportQuickAction
\ No newline at end of file
diff --git a/src/app/admin-dashboard/components/SupportReply.tsx b/src/app/admin-dashboard/components/SupportReply.tsx
new file mode 100644
index 0000000..5774766
--- /dev/null
+++ b/src/app/admin-dashboard/components/SupportReply.tsx
@@ -0,0 +1,84 @@
+import { useState } from "react";
+import { CheckCircle } from "lucide-react";
+
+interface ReplyModalProps {
+ isOpen: boolean;
+ onClose: () => void;
+}
+
+export default function ReplyModal({ isOpen, onClose }: ReplyModalProps) {
+ const [status, setStatus] = useState<"reply" | "sent" | "deleted">("reply");
+
+ if (!isOpen) return null;
+
+ return (
+
+
+
+ {status === "reply" && (
+
setStatus("deleted")}
+ className="text-gray-400 text-xl hover:text-white"
+ >
+ ← Go Back
+
+ )}
+
+ {status === "reply" && (
+ <>
+
Reply Ticket
+
+
+
+
+
+
+
setStatus("sent")}
+ className="mt-4 lg:w-[30%] bg-[#1B0055] px-4 py-2 border border-[#C0BFC6] rounded-2xl hover:bg-[#290080a4]"
+ >
+ Send Message
+
+ >
+ )}
+
+ {status === "sent" && (
+
+
+
Reply Sent
+
+ Message sent to user's email address. Please continue discussion or
settle disputes in mailbox.
+
+
+ Close
+
+
+ )}
+
+ {status === "deleted" && (
+
+
+
Delete Successful
+
Question deleted successfully.
+
+ Close
+
+
+ )}
+
+
+ );
+}
diff --git a/src/app/admin-dashboard/components/SupportSearchBar.tsx b/src/app/admin-dashboard/components/SupportSearchBar.tsx
new file mode 100644
index 0000000..9b00bd3
--- /dev/null
+++ b/src/app/admin-dashboard/components/SupportSearchBar.tsx
@@ -0,0 +1,32 @@
+import Image from "next/image";
+import { Search, Download } from "lucide-react";
+
+export default function SearchBar() {
+ return (
+
+
+
+
+
+
+ Search
+
+
+
+
+
+
+ Download CSV
+
+
+
+ All
+
+
+
+ );
+}
diff --git a/src/app/admin-dashboard/components/SupportStatCard.tsx b/src/app/admin-dashboard/components/SupportStatCard.tsx
new file mode 100644
index 0000000..ea8a12b
--- /dev/null
+++ b/src/app/admin-dashboard/components/SupportStatCard.tsx
@@ -0,0 +1,55 @@
+import Image from "next/image";
+
+interface Stat {
+ icon: string;
+ label: string;
+ value: string;
+}
+
+const stats: Stat[] = [
+ {
+ icon: "/svg/ticket.svg",
+ label: "Total Support Tickets",
+ value: "58",
+ },
+ {
+ icon: "/svg/ticket.svg",
+ label: "Unanswered Support Tickets",
+ value: "45",
+ },
+ {
+ icon: "/svg/question.svg",
+ label: "Total FAQs ",
+ value: "28",
+ },
+];
+
+const SupportStatCard = () => {
+ return (
+
+ {stats.map((stat, index) => (
+
+
+
+
{stat.label}
+
{stat.value}
+
+
+ ))}
+
+ );
+};
+
+export default SupportStatCard;
diff --git a/src/app/admin-dashboard/components/SupportTicket.tsx b/src/app/admin-dashboard/components/SupportTicket.tsx
new file mode 100644
index 0000000..6ed0d31
--- /dev/null
+++ b/src/app/admin-dashboard/components/SupportTicket.tsx
@@ -0,0 +1,91 @@
+"use client";
+
+import { useState } from "react";
+import { ChevronDown } from "lucide-react";
+import SupportTicketDetailUnanswered from "../components/SupportTicketDetailUnanswered";
+import SupportTicketDetailAnswered from "../components/SupportTicketDetailAnswered";
+
+interface SupportTicketType {
+ date: string;
+ id: string;
+ email: string;
+ subject: string;
+ status: string;
+ userId: string;
+ description: string;
+ attachments: string[];
+}
+
+export default function SupportTicket() {
+
+ const [selectedTicket, setSelectedTicket] = useState(null);
+
+ return (
+
+
+
+
+
+
+
+
+ | Date |
+ Ticket ID |
+ Email |
+ Subject |
+ Status |
+ Action |
+
+
+
+ {[
+ { date: "24 - 01 - 2025", id: "24224", email: "danielochoja@gmail.com", subject: "Inheritance", status: "Answered" },
+ { date: "24 - 01 - 2025", id: "34263", email: "daviechoe@inherix.com", subject: "Claims", status: "Answered" },
+ { date: "24 - 01 - 2025", id: "35521", email: "nazried@jaspertech.org", subject: "Assets", status: "Unanswered" }
+ ].map(ticket => (
+
+ | {ticket.date} |
+ {ticket.id} |
+ {ticket.email} |
+ {ticket.subject} |
+ {ticket.status} |
+
+ {
+ e.preventDefault();
+ setSelectedTicket({
+ ...ticket,
+ userId: "N/A",
+ description: "No description available.",
+ attachments: [],
+ });
+ }}
+
+ >
+ View
+
+ |
+
+ ))}
+
+
+
+
+
+ {/* Ticket Details Modal - Render based on status */}
+ {selectedTicket && (
+ selectedTicket.status === "Answered" ?
+
setSelectedTicket(null)} />
+ :
+ setSelectedTicket(null)} />
+ )}
+
+ );
+}
diff --git a/src/app/admin-dashboard/components/SupportTicketDetailAnswered.tsx b/src/app/admin-dashboard/components/SupportTicketDetailAnswered.tsx
new file mode 100644
index 0000000..d73f4d5
--- /dev/null
+++ b/src/app/admin-dashboard/components/SupportTicketDetailAnswered.tsx
@@ -0,0 +1,110 @@
+"use client";
+
+import { useState } from "react";
+import { FileText, Link } from "lucide-react";
+import SupportReply from "../components/SupportReply";
+
+interface SupportTicketType {
+ id: string;
+ userId?: string;
+ subject: string;
+ email: string;
+ status: string;
+ description?: string;
+ attachments?: string[];
+}
+
+interface SupportTicketDetailsAnsweredProps {
+ ticket: SupportTicketType;
+ onClose: () => void;
+}
+
+export default function SupportTicketDetailsAnswered({ ticket, onClose }: SupportTicketDetailsAnsweredProps) {
+ const [isReplyOpen, setIsReplyOpen] = useState(false);
+
+ if (!ticket) {
+ return null;
+ }
+
+ const defaultUserId = "12345";
+ const defaultDescription = `For some reason, I can't create an inheritance plan.
+ How do I go about this? I want to leave a huge sum of money for my daughter.`;
+ const defaultAttachments = ["Screenshot23422332", "Screenshot23422332"];
+
+ if (isReplyOpen) {
+ return setIsReplyOpen(false)} />;
+ }
+
+ return (
+
+
+
Ticket Details
+
+
+
+
+
+
+
+
+
+
+
Attachment(s)
+
+ {ticket.attachments && ticket.attachments.length > 0
+ ? ticket.attachments.map((file, index) =>
)
+ : defaultAttachments.map((file, index) =>
)}
+
+
+
+
+
+ setIsReplyOpen(true)}
+ className="bg-[#280080] border border-[#C0BFC6] px-10 py-1 rounded-2xl hover:bg-[#290080a4]"
+ >
+ Reply
+
+
+ Close
+
+
+
+
+
setIsReplyOpen(false)} />
+
+ );
+}
+
+interface TicketRowProps {
+ label: string;
+ value: string;
+ multiLine?: boolean;
+}
+
+const TicketRow = ({ label, value, multiLine }: TicketRowProps) => (
+
+ {label}
+ {value}
+
+);
+
+interface AttachmentProps {
+ fileName: string;
+}
+
+const Attachment = ({ fileName }: AttachmentProps) => (
+
+);
diff --git a/src/app/admin-dashboard/components/SupportTicketDetailUnanswered.tsx b/src/app/admin-dashboard/components/SupportTicketDetailUnanswered.tsx
new file mode 100644
index 0000000..48604fb
--- /dev/null
+++ b/src/app/admin-dashboard/components/SupportTicketDetailUnanswered.tsx
@@ -0,0 +1,96 @@
+import { useState } from "react";
+import { FileText, Link } from "lucide-react";
+import SupportReply from "../components/SupportReply";
+
+interface SupportTicket {
+ id: string;
+ userId: string;
+ subject: string;
+ email: string;
+ status: string;
+ description: string;
+ attachments: string[];
+}
+
+interface Props {
+ ticket: SupportTicket;
+ onClose: () => void;
+}
+
+export default function SupportTicketDetailsUnanswered({ ticket, onClose }: Props) {
+ const [isReplyOpen, setIsReplyOpen] = useState(false);
+
+ if (!ticket) {
+ return null;
+ }
+
+ const defaultUserId = "12345";
+ const defaultDescription = `For some reason, I can't create an inheritance plan.
+ How do I go about this? I want to leave a huge sum of money for my daughter.`;
+ const defaultAttachments = ["Screenshot23422332", "Screenshot23422332"];
+
+ if (isReplyOpen) {
+ return setIsReplyOpen(false)} />;
+ }
+
+ return (
+
+
+
Ticket Details
+
+
+
+
+
+
+
+
+
+
+
Attachment(s)
+
+ {ticket.attachments && ticket.attachments.length > 0
+ ? ticket.attachments.map((file, index) =>
)
+ : defaultAttachments.map((file, index) =>
)}
+
+
+
+
+
+ setIsReplyOpen(true)}
+ className="bg-[#280080] border border-[#C0BFC6] px-10 py-1 rounded-2xl hover:bg-[#290080a4]"
+ >
+ Reply
+
+
+ Mark as answered
+
+
+ Close
+
+
+
+
+ );
+}
+
+const TicketRow = ({ label, value, multiLine }: { label: string; value: string; multiLine?: boolean }) => (
+
+ {label}
+ {value}
+
+);
+
+const Attachment = ({ fileName }: { fileName: string }) => (
+
+);
diff --git a/src/app/admin-dashboard/support/page.tsx b/src/app/admin-dashboard/support/page.tsx
index 8240494..7204a90 100644
--- a/src/app/admin-dashboard/support/page.tsx
+++ b/src/app/admin-dashboard/support/page.tsx
@@ -1,7 +1,22 @@
import React from 'react'
+import SupportStatCard from "../components/SupportStatCard"
+import SupportQuickAction from '../components/SupportQuickAction'
+import SupportSearchBar from "../components/SupportSearchBar"
+import SupportTicket from '../components/SupportTicket'
+import SupportFaqs from '../components/SupportFaqs'
export default function support() {
return (
- support
+ <>
+
+
+
+
+
+
+
+
+
+ >
)
}