-
+
Send Invite
-
setInputValue(e.target.value)}
- className="w-full mb-4 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-[var(--primary)]"
- />
+
+ {/* Account Name Dropdown */}
+
handleDropdownBlur(e, accountDropdownRef, setIsAccountDropdownOpen)}>
+
+
+
+ {isAccountDropdownOpen && !accountOptionsLoading && (
+
+ {filteredOptions.length > 0 ? (
+ filteredOptions.map((opt) => (
+ - handleAccountSelect(opt)}
+ >
+ {opt.accountName}
+
+ ))
+ ) : (
+ - No results found
+ )}
+
+ )}
+
+ {errors.i_accountName &&
{errors.i_accountName}
}
+
+
+ {/* Email Field */}
+
+
+
handleInviteChange("email", e.target.value)}
+ className="w-full px-3 py-1.5 text-gray-600 rounded-md border border-gray-400 focus:outline-none focus:ring-1 focus:ring-[var(--primary)] disabled:opacity-60 disabled:cursor-not-allowed"
+ />
+ {errors.email &&
{errors.email}
}
+
+
+ {/* Role Dropdown */}
+
handleDropdownBlur(e, roleDropdownRef, setIsRoleDropdownOpen)}>
+
+
+
+ {isRoleDropdownOpen && (
+
+ {roles.map((role) => (
+
handleRoleSelect(role)}
+ >
+ {role}
+
+ ))}
+
+ )}
+
+ {errors.role &&
{errors.role}
}
+
+
+ {/* Buttons */}
- )
-}
+ );
+};
-export default AddInviteModal
\ No newline at end of file
+export default AddInviteModal;
diff --git a/src/components/home/Cards.tsx b/src/components/home/Cards.tsx
index 16dbc30..3a8802a 100644
--- a/src/components/home/Cards.tsx
+++ b/src/components/home/Cards.tsx
@@ -1,18 +1,31 @@
import React, { useEffect, useState } from 'react';
-import { FaCheckCircle, FaClock, FaHourglassHalf, FaTasks } from 'react-icons/fa';
+import {
+ FaCheckCircle,
+ FaClock,
+ FaHourglassHalf,
+ FaTasks,
+ FaChevronDown,
+ FaPlus,
+ FaUserPlus,
+ FaFilter,
+ FaCalendarAlt
+} from 'react-icons/fa';
// Define a type for card data
interface CardData {
title: string;
count: number;
icon: JSX.Element;
- ring: string;
- bg: string;
+ gradient: string;
+ shadowColor: string;
+ iconBg: string;
+ textColor: string;
+ percentage?: number;
+ trend?: 'up' | 'down' | 'stable';
}
interface CardsProps {
- type?: 'dashboard';
- // onCardClick?: (card: CardData) => void;
+ type?: 'dashboard' | 'account' | 'transactions';
onOpenModal?: () => void;
}
@@ -20,129 +33,266 @@ const cards: CardData[] = [
{
title: 'Action Required',
count: 12,
- icon:
,
- ring: 'ring-orange-400/20',
- bg: 'bg-orange-50',
- },
- {
- title: 'Waiting for Others',
- count: 8,
- icon:
,
- ring: 'ring-yellow-400/20',
- bg: 'bg-yellow-50',
+ icon:
,
+ gradient: 'bg-gradient-to-br from-indigo-50 to-indigo-100',
+ shadowColor: 'shadow-indigo-200/50',
+ iconBg: 'bg-indigo-100 border-indigo-200',
+ textColor: 'text-indigo-700',
+ trend: 'up'
},
+
{
title: 'Expiring Soon',
count: 5,
- icon:
,
- ring: 'ring-red-400/20',
- bg: 'bg-red-50',
+ icon:
,
+ gradient: 'bg-gradient-to-br from-rose-50 to-rose-100',
+ shadowColor: 'shadow-rose-200/50',
+ iconBg: 'bg-rose-100 border-rose-200',
+ textColor: 'text-rose-700',
+ trend: 'up'
},
{
title: 'Completed',
count: 27,
- icon:
,
- ring: 'ring-green-400/20',
- bg: 'bg-green-50',
+ icon:
,
+ gradient: 'bg-gradient-to-br from-teal-50 to-teal-100',
+ shadowColor: 'shadow-teal-200/50',
+ iconBg: 'bg-teal-100 border-teal-200',
+ textColor: 'text-teal-700',
+ trend: 'up'
+ },
+ {
+ title: 'Waiting for Others',
+ count: 8,
+ icon:
,
+ gradient: 'bg-gradient-to-br from-stone-50 to-stone-100',
+ shadowColor: 'shadow-stone-200/50',
+ iconBg: 'bg-stone-100 border-stone-200',
+ textColor: 'text-stone-700',
+ trend: 'down'
},
];
const AccountData: CardData[] = [
{
- title: 'Transaction',
+ title: 'Active Accounts',
count: 12,
- icon:
,
- ring: 'ring-orange-400/20',
- bg: 'bg-orange-50',
+ icon:
,
+ gradient: 'bg-gradient-to-br from-blue-50 to-blue-100',
+ shadowColor: 'shadow-blue-200/50',
+ iconBg: 'bg-blue-100 border-blue-200',
+ textColor: 'text-blue-700',
+ trend: 'up'
},
{
title: 'In-Progress',
count: 8,
- icon:
,
- ring: 'ring-yellow-400/20',
- bg: 'bg-yellow-50',
- },
- {
- title: 'Deactive',
- count: 5,
- icon:
,
- ring: 'ring-red-400/20',
- bg: 'bg-red-50',
+ icon:
,
+ gradient: 'bg-gradient-to-br from-purple-50 to-purple-100',
+ shadowColor: 'shadow-purple-200/50',
+ iconBg: 'bg-purple-100 border-purple-200',
+ textColor: 'text-purple-700',
+ trend: 'stable'
},
+
{
title: 'Completed',
count: 27,
- icon:
,
- ring: 'ring-green-400/20',
- bg: 'bg-green-50',
+ icon:
,
+ gradient: 'bg-gradient-to-br from-green-50 to-green-100',
+ shadowColor: 'shadow-green-200/50',
+ iconBg: 'bg-green-100 border-green-200',
+ textColor: 'text-green-700',
+ trend: 'up'
+ },
+ {
+ title: 'Inactive',
+ count: 5,
+ icon:
,
+ gradient: 'bg-gradient-to-br from-gray-50 to-gray-100',
+ shadowColor: 'shadow-gray-200/50',
+ iconBg: 'bg-gray-100 border-gray-200',
+ textColor: 'text-gray-700',
+ trend: 'down'
},
];
const filters = ['Last 7 Days', 'Last 30 Days', 'Last 6 Months', 'This Year'];
+const accounts = ['All Accounts', 'Account 1', 'Account 2', 'Account 3'];
-const Cards: React.FC
= ({ type, onOpenModal }) => {
+const Cards: React.FC = ({ type = 'dashboard', onOpenModal }) => {
const [selectedFilter, setSelectedFilter] = useState('Last 7 Days');
+ const [selectedAccount, setSelectedAccount] = useState('All Accounts');
const [showCards, setShowCards] = useState([]);
+ const [isLoading, setIsLoading] = useState(true);
useEffect(() => {
- if (type === 'account') {
- setShowCards(AccountData);
- } else {
- setShowCards(cards);
- }
+ setIsLoading(true);
+ setTimeout(() => {
+ if (type === 'account') {
+ setShowCards(AccountData);
+ } else {
+ setShowCards(cards);
+ }
+ setIsLoading(false);
+ }, 500);
}, [type]);
- return (
-
- {/* Header */}
-
-
Overview
+ const getButtonConfig = () => {
+ switch (type) {
+ case 'account':
+ return {
+ text: 'Add Account',
+ icon:
,
+ gradient: 'bg-gradient-to-r from-blue-600 to-blue-700 hover:from-blue-700 hover:to-blue-800'
+ };
+ case 'transactions':
+ return {
+ text: 'Send Invite',
+ icon:
,
+ gradient: 'bg-gradient-to-r from-emerald-600 to-emerald-700 hover:from-emerald-700 hover:to-emerald-800'
+ };
+ default:
+ return null;
+ }
+ };
-
+ const buttonConfig = getButtonConfig();
+
+ const renderTrendIndicator = (trend: string | undefined, percentage: number | undefined) => {
+ if (!trend || !percentage) return null;
+
+ const trendColors = {
+ up: 'text-emerald-500',
+ down: 'text-red-500',
+ stable: 'text-gray-500'
+ };
+
+ const trendSymbols = {
+ up: '↗',
+ down: '↘',
+ stable: '→'
+ };
+
+ return (
+
+ {trendSymbols[trend as keyof typeof trendSymbols]}
+ {/* {percentage}% */}
+
+ );
+ };
+
+ if (isLoading) {
+ return (
+
+
+
+
+ {[...Array(4)].map((_, i) => (
+
+ ))}
+
+
+
+ );
+ }
+
+ return (
+
+ {/* Header */}
+
+
+
+
+
+
+
Overview
+
Monitor performance metrics
+
+
+
+
{/* Account Selector */}
-
+
+
+
+
{/* Date Filter */}
-
+
+
+
+
- {type === 'account' &&
-
}
+ {/* Action Button */}
+ {buttonConfig && (
+
+ )}
{/* Cards */}
-
- {showCards.map((card) => (
+
+ {showCards.map((card, index) => (
-
-
- {card.icon}
+ {/* Background Pattern */}
+
+
+ {/* Content */}
+
+
+
+ {card.icon}
+
+ {renderTrendIndicator(card.trend, card.percentage)}
-
-
{card.title}
-
{card.count}
+
+
+
+ {card.title}
+
+
+
+ {card.count}
+
+
items
+
+
+ {/* Hover Effect */}
+
))}
@@ -150,4 +300,4 @@ const Cards: React.FC
= ({ type, onOpenModal }) => {
);
};
-export default Cards;
+export default Cards;
\ No newline at end of file
diff --git a/src/components/home/Home.tsx b/src/components/home/Home.tsx
index 7042022..8b7e70b 100644
--- a/src/components/home/Home.tsx
+++ b/src/components/home/Home.tsx
@@ -5,11 +5,13 @@ import FilterSort from './FilterSort'
import ShowDocs from './ShowDocs'
import Cards from './Cards'
import StartSection from './StartSection'
+import AccountNav from '../accounts/AccountNav'
const Home = () => {
return (
<>
-
+ {/* */}
+
{/* */}
diff --git a/src/components/home/HomeTopNav.tsx b/src/components/home/HomeTopNav.tsx
index 8cd21e3..99cbe23 100644
--- a/src/components/home/HomeTopNav.tsx
+++ b/src/components/home/HomeTopNav.tsx
@@ -33,7 +33,7 @@ const HomeTopNav = () => {
diff --git a/src/components/setting/Setting.tsx b/src/components/setting/Setting.tsx
index 27c551e..abc4e3a 100644
--- a/src/components/setting/Setting.tsx
+++ b/src/components/setting/Setting.tsx
@@ -8,6 +8,7 @@ import CreateAndInvite, { ActionType, FormDataType } from './CreateAndInvite'
import AsideSection from "./AsideSection";
import Signature from "./Signature/Signature";
import { Bounce, toast } from "react-toastify";
+import AccountNav from "../accounts/AccountNav";
// Define the shape of state object
interface Account {
@@ -256,6 +257,7 @@ const Setting = () => {
// Set initial subsection when component mounts or activeTab changes
useEffect(() => {
const subSections = getSubSections(activeTab);
+ console.log("subSections",subSections)
const hash = location.hash.replace('#', '');
if (subSections.length > 0) {
@@ -336,6 +338,7 @@ const Setting = () => {
return (
<>
+ {/* */}
{/* Main Navigation Tabs */}
@@ -359,7 +362,7 @@ const Setting = () => {
{/* Content with Aside Navigation */}
-
+
{/* Fixed Aside Navigation - Shows subsections of active tab */}
{activeTab === 'userProfile' &&
diff --git a/src/components/setting/Signature/AddSignatureModal.tsx b/src/components/setting/Signature/AddSignatureModal.tsx
index 86c2fbb..a92c172 100644
--- a/src/components/setting/Signature/AddSignatureModal.tsx
+++ b/src/components/setting/Signature/AddSignatureModal.tsx
@@ -505,7 +505,7 @@ const AddSignatureModal: React.FC = ({
CANCEL
-