Tab Constant is added

This commit is contained in:
2026-07-29 14:39:55 +05:30
parent 7ce1f2705e
commit f9c3e7968b
28 changed files with 1299 additions and 1093 deletions

View File

@@ -6,8 +6,6 @@ import {
Star,
BarChart2,
Plus,
ShieldCheck,
Clock
} from "lucide-react";
import Button from "@/components/common/button";
import StatCard from "@/components/common/dashStatCard";
@@ -21,25 +19,11 @@ import { CardHeader } from "@/components/common/cardHeader";
import BarChart from "@/components/charts/barchart";
import InfoBanner from '@/components/common/infoBanner';
import { sustainabilitytabs } from '@/constants/constant';
import { EMISSION_SOURCES, energyData, } from '@/constants/constant';
import { sustainabilitytabs } from '@/constants/tabConstant';
// Sample Bar Chart Data for Carbon Emissions
const CARBON_EMISSIONS_DATA = [
{ month: 'Jan', height: 'h-32' },
{ month: 'Feb', height: 'h-32' },
{ month: 'Mar', height: 'h-32' },
{ month: 'Apr', height: 'h-32' },
{ month: 'May', height: 'h-32' },
{ month: 'Jun', height: 'h-28' },
];
// Emission Sources Progress Data
const EMISSION_SOURCES = [
{ name: "Purchased electricity", percentage: "58%", width: "w-[58%]", color: "bg-sky-400" },
{ name: "DG / fuel combustion", percentage: "21%", width: "w-[21%]", color: "bg-amber-400" },
{ name: "Refrigerants (fugitive)", percentage: "12%", width: "w-[12%]", color: "bg-rose-400" },
{ name: "Water & waste", percentage: "9%", width: "w-[9%]", color: "bg-slate-400" },
];
export default function SustainabilityPortal() {
const [activeTab, setActiveTab] = useState<string>('ESG Data Hub');
@@ -49,12 +33,12 @@ export default function SustainabilityPortal() {
{/* --- HEADER SECTION --- */}
<div className="flex flex-col md:flex-row md:items-start md:justify-between gap-4 mb-6">
<div>
<div className="flex items-center gap-2 text-[10px] font-bold tracking-widest uppercase font-mono">
<div className="flex items-center gap-2 text-[12px] font-bold tracking-widest uppercase font-mono">
<span className="text-teal-400">Apple One HQ Tower</span>
<span className="text-slate-500"></span>
<span className="text-slate-500">INTELLIGENCE</span>
<span className="text-slate-500"></span>
<span className="text-slate-500">SUSTAINABILITY</span>
<span className="text-slate-600"></span>
<span className="text-slate-400">INTELLIGENCE</span>
<span className="text-slate-600"></span>
<span className="text-slate-400">SUSTAINABILITY</span>
</div>
<h1 className="text-2xl font-bold text-white tracking-tight mt-2">
ESG One sustainability platform
@@ -140,7 +124,7 @@ export default function SustainabilityPortal() {
{/* --- ESG CARDS SECTION BELOW TABS --- */}
<div className="grid grid-cols-1 md:grid-cols-3 gap-4 mb-6">
{/* Environmental Card */}
<Card className="bg-[#08121e] border-[#132235] p-5 rounded-xl">
<Card className=" p-5 ">
<CardHeader title="Environmental" subtitle="metered · live" />
<div className="mt-4 space-y-3.5 text-xs">
<div className="flex items-center justify-between">
@@ -175,7 +159,7 @@ export default function SustainabilityPortal() {
</Card>
{/* Social Card */}
<Card className="bg-[#08121e] border-[#132235] p-5 rounded-xl">
<Card className="p-5">
<CardHeader title="Social" subtitle="people & occupants" />
<div className="mt-4 space-y-3.5 text-xs">
<div className="flex items-center justify-between">
@@ -210,7 +194,7 @@ export default function SustainabilityPortal() {
</Card>
{/* Governance Card */}
<Card className="bg-[#08121e] border-[#132235] p-5 rounded-xl">
<Card className=" p-5 ">
<CardHeader title="Governance" subtitle="compliance & ethics" />
<div className="mt-4 space-y-3.5 text-xs">
<div className="flex items-center justify-between">
@@ -249,17 +233,17 @@ export default function SustainabilityPortal() {
<div className="grid grid-cols-1 lg:grid-cols-12 gap-4 mb-6">
{/* Left: Carbon Emissions BarChart */}
<div className="lg:col-span-7">
<Card className="bg-[#08121e] border-[#132235] p-5 rounded-xl h-full flex flex-col justify-between">
<Card className="p-5 h-full flex flex-col justify-between">
<CardHeader title="Carbon emissions · tCO₂e" subtitle="2026 · trending down" />
<div className="mt-6">
<BarChart data={CARBON_EMISSIONS_DATA} />
<BarChart data={energyData} />
</div>
</Card>
</div>
{/* Right: Emission Sources */}
<div className="lg:col-span-5">
<Card className="bg-[#08121e] border-[#132235] p-5 rounded-xl h-full flex flex-col justify-between">
<Card className=" h-full flex flex-col justify-between">
<CardHeader title="Emission sources" subtitle="drill down by site / meter" />
<div className="mt-5 space-y-4">
{EMISSION_SOURCES.map((source, idx) => (