From abc6c011ea7189df4775f7d3b9e892774cdff885 Mon Sep 17 00:00:00 2001 From: "IGNY8 VPS (Salman)" Date: Mon, 5 Jan 2026 05:06:30 +0000 Subject: [PATCH] phase 1 complete --- frontend/src/components/common/SiteCard.tsx | 77 ++++++++------------- frontend/src/components/ui/badge/Badge.tsx | 6 +- frontend/src/components/ui/card/Card.tsx | 3 +- frontend/src/pages/Sites/List.tsx | 44 ++++++------ 4 files changed, 58 insertions(+), 72 deletions(-) diff --git a/frontend/src/components/common/SiteCard.tsx b/frontend/src/components/common/SiteCard.tsx index 09a378d6..2c0f8071 100644 --- a/frontend/src/components/common/SiteCard.tsx +++ b/frontend/src/components/common/SiteCard.tsx @@ -28,22 +28,6 @@ export default function SiteCard({ onToggle(site.id, enabled); }; - const getStatusColor = () => { - if (site.is_active) { - return 'bg-success-500 dark:bg-success-600'; - } - return 'bg-gray-400 dark:bg-gray-500'; - }; - - const getStatusText = () => { - if (site.is_active) { - return { text: 'Active', color: 'text-success-600 dark:text-success-400', bold: true }; - } - return { text: 'Inactive', color: 'text-gray-400 dark:text-gray-500', bold: false }; - }; - - const statusText = getStatusText(); - // Setup checklist state derived from site data const hasIndustry = !!site.industry || !!site.industry_name; const hasSectors = site.active_sectors_count > 0; @@ -52,26 +36,28 @@ export default function SiteCard({ return (
-
+
-
+
{icon}
-

- {site.name} -

+
+

+ {site.name} +

+ {site.domain && ( +

+ {site.domain} +

+ )} +
- {site.domain && ( -

- {site.domain} -

- )} {site.description && ( -

+

{site.description}

)} -
+
{site.industry_name && ( @@ -81,11 +67,6 @@ export default function SiteCard({ {site.active_sectors_count} / 5 Sectors - {site.status && ( - - {site.status} - - )}
{/* Setup Checklist - Compact View */}
@@ -99,19 +80,25 @@ export default function SiteCard({ compact={true} />
- {/* Status Text and Circle - Same row */} + {/* Status badge and toggle in top right */}
- - {statusText.text} - -
+ + {site.is_active ? 'Active' : 'Inactive'} +
-
-
+
+
-
); diff --git a/frontend/src/components/ui/badge/Badge.tsx b/frontend/src/components/ui/badge/Badge.tsx index 417dd37c..b18f8ea7 100644 --- a/frontend/src/components/ui/badge/Badge.tsx +++ b/frontend/src/components/ui/badge/Badge.tsx @@ -105,9 +105,9 @@ const toneStyles: Record< }; const sizeClasses: Record = { - xs: "min-h-[20px] px-2.5 py-1 leading-[1.4]", - sm: "min-h-[24px] px-3 py-1 leading-[1.4]", - md: "min-h-[28px] px-3.5 py-1.5 leading-[1.4]", + xs: "min-h-[18px] px-1.5 py-0.5 text-xs leading-tight", + sm: "min-h-[22px] px-2 py-0.5 text-xs leading-tight", + md: "min-h-[26px] px-3 py-1 text-sm leading-tight", }; const Badge: React.FC = ({ diff --git a/frontend/src/components/ui/card/Card.tsx b/frontend/src/components/ui/card/Card.tsx index 4735f20d..f0ca72ed 100644 --- a/frontend/src/components/ui/card/Card.tsx +++ b/frontend/src/components/ui/card/Card.tsx @@ -3,7 +3,7 @@ import clsx from "clsx"; import Button from "../button/Button"; type CardVariant = "surface" | "panel" | "frosted" | "borderless" | "gradient"; -type CardPadding = "none" | "sm" | "md" | "lg"; +type CardPadding = "none" | "xs" | "sm" | "md" | "lg"; type CardShadow = "none" | "sm" | "md"; interface CardProps { @@ -37,6 +37,7 @@ export const Card: React.FC = ({ const paddingClasses: Record = { none: "p-0", + xs: "p-3", sm: "p-4 sm:p-5", md: "p-5 sm:p-6", lg: "p-6 sm:p-8", diff --git a/frontend/src/pages/Sites/List.tsx b/frontend/src/pages/Sites/List.tsx index c7a9f050..36d63b27 100644 --- a/frontend/src/pages/Sites/List.tsx +++ b/frontend/src/pages/Sites/List.tsx @@ -393,37 +393,41 @@ export default function SiteList() { const renderGridView = () => (
{filteredSites.map((site) => ( - -
-
-
- + +
+
+
+
-

- {site.name} -

+
+

+ {site.name} +

+ {site.domain && ( +

+ {site.domain} +

+ )} +
-

- {site.description || 'No description'} -

- {site.domain && ( -

- {site.domain} + {site.description && ( +

+ {site.description}

)} - {/* Centered badges with uniform size */} -
- + {/* Centered badges with smaller size */} +
+ {site.industry_name && ( - + {site.industry_name} )}
{/* Status badge and toggle in top right */} -
+
handleToggle(site.id, enabled)} @@ -439,7 +443,7 @@ export default function SiteList() {
{/* Centered button row */} -
+