From 84f4f7edba7d4ff17bfb964302893e5a65a66f45 Mon Sep 17 00:00:00 2001 From: yaschalew Date: Fri, 15 May 2026 14:42:04 +0300 Subject: [PATCH] add customers page --- apps/edr-freight-web/portal/package.json | 1 + apps/edr-freight-web/portal/src/App.tsx | 3 + .../src/pages/customers/CustomersPage.tsx | 221 ++++++++++++++++++ pnpm-lock.yaml | 3 + 4 files changed, 228 insertions(+) create mode 100644 apps/edr-freight-web/portal/src/pages/customers/CustomersPage.tsx diff --git a/apps/edr-freight-web/portal/package.json b/apps/edr-freight-web/portal/package.json index a0e1de6b0..ee0fa55c5 100644 --- a/apps/edr-freight-web/portal/package.json +++ b/apps/edr-freight-web/portal/package.json @@ -18,6 +18,7 @@ "@tria-plc/iamui-common": "1.1.1", "axios": "^1.7.7", "clsx": "^2.1.1", + "lucide-react": "^1.14.0", "react": "^18.3.1", "react-dom": "^18.3.1", "react-router-dom": "^6.27.0", diff --git a/apps/edr-freight-web/portal/src/App.tsx b/apps/edr-freight-web/portal/src/App.tsx index 6b788db70..804b8a680 100644 --- a/apps/edr-freight-web/portal/src/App.tsx +++ b/apps/edr-freight-web/portal/src/App.tsx @@ -17,9 +17,11 @@ import BillingPage from "./pages/billing/BillingPage"; import TrainsPage from "./pages/trains/TrainsPage"; import DashboardPage from "./pages/dashboard/DashboardPage"; import { IamLoginPage } from "@tria-plc/iamui-common"; +import CustomersPage from "./pages/customers/CustomersPage"; const sidebarItems: SidebarItem[] = [ { label: "Dashboard", href: "/" }, + { label: "Customers", href: "/Customers" }, { label: "Bookings", href: "/bookings" }, { label: "Consignments", href: "/consignments" }, { label: "Tracking", href: "/tracking" }, @@ -50,6 +52,7 @@ const App = () => { } /> } /> + } /> } /> } /> } /> diff --git a/apps/edr-freight-web/portal/src/pages/customers/CustomersPage.tsx b/apps/edr-freight-web/portal/src/pages/customers/CustomersPage.tsx new file mode 100644 index 000000000..3beb61bdc --- /dev/null +++ b/apps/edr-freight-web/portal/src/pages/customers/CustomersPage.tsx @@ -0,0 +1,221 @@ +export default function CustomerPage() { + const customers = [ + { + id: 1, + name: 'Abel Tesfaye', + email: 'abel@example.com', + company: 'Addis Logistics', + status: 'Active', + }, + { + id: 2, + name: 'Sara Bekele', + email: 'sara@example.com', + company: 'Blue Nile Trading', + status: 'Pending', + }, + { + id: 3, + name: 'Henok Alemu', + email: 'henok@example.com', + company: 'Ethio Freight', + status: 'Inactive', + }, + ]; + + return ( +
+
+ {/* Header */} +
+
+

+ Customers +

+

+ Manage and monitor your customer records. +

+
+ +
+ + + +
+
+ + {/* Stats */} +
+ } + /> + + } + /> + + } + /> +
+ + {/* Customer Table */} +
+
+
+

+ Customer List +

+

+ Recent customer activities and records. +

+
+ + +
+ +
+ + + + + + + + + + + + + {customers.map((customer) => ( + + + + + + + + + + + + ))} + +
CustomerCompanyEmailStatus + Actions +
+
+
+ +
+ +
+

+ {customer.name} +

+

+ ID #{customer.id} +

+
+
+
+ {customer.company} + + {customer.email} + + + +
+ + + + + +
+
+
+
+
+
+ ); +} + +function StatCard({ + title, + value, + icon, +}: { + title: string; + value: string; + icon: React.ReactNode; +}) { + return ( +
+
+
+

{title}

+

+ {value} +

+
+ +
+ {icon} +
+
+
+ ); +} + +function StatusBadge({ status }: { status: string }) { + const styles: Record = { + Active: 'bg-emerald-100 text-emerald-700', + Pending: 'bg-amber-100 text-amber-700', + Inactive: 'bg-red-100 text-red-700', + }; + + return ( + + {status} + + ); +} + +import { + Clock3, + Eye, + Filter, + Pencil, + Plus, + Search, + Trash2, + User, + UserCheck, + Users, +} from 'lucide-react'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 82b65bed9..075510065 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -229,6 +229,9 @@ importers: clsx: specifier: ^2.1.1 version: 2.1.1 + lucide-react: + specifier: ^1.14.0 + version: 1.14.0(react@18.3.1) react: specifier: 18.3.1 version: 18.3.1