Constant data is added and resuable tabs added
This commit is contained in:
@@ -13,19 +13,13 @@ import {
|
|||||||
import Button from "@/utils/button";
|
import Button from "@/utils/button";
|
||||||
import StatCard from "@/utils/dashStatCard";
|
import StatCard from "@/utils/dashStatCard";
|
||||||
import LocationTable from '../../utils/table';
|
import LocationTable from '../../utils/table';
|
||||||
|
import NavigationTabs from '@/utils/tabs';
|
||||||
|
import { equipmentTabs } from '@/constants/constant';
|
||||||
|
|
||||||
export default function EquipmentPortal() {
|
export default function EquipmentPortal() {
|
||||||
const [activeTab, setActiveTab] = useState<string>('Site-Wise Equipment');
|
const [activeTab, setActiveTab] = useState<string>('Site-Wise Equipment');
|
||||||
|
|
||||||
const tabs: string[] = [
|
|
||||||
'Equipment Groups',
|
|
||||||
'Site-Wise Equipment',
|
|
||||||
'PPM Checklist',
|
|
||||||
'AMC Checklist',
|
|
||||||
'PPM Schedule',
|
|
||||||
'AMC Schedule',
|
|
||||||
'Maintenance Calendar'
|
|
||||||
];
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="my-15 text-slate-100 max-w-7xl mx-auto font-sans">
|
<div className="my-15 text-slate-100 max-w-7xl mx-auto font-sans">
|
||||||
@@ -49,23 +43,14 @@ export default function EquipmentPortal() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* --- NAVIGATION TABS --- */}
|
|
||||||
<div className="flex items-center gap-8 border-b border-slate-800/80 mb-6 text-sm font-semibold overflow-x-auto no-scrollbar">
|
{/* Navigation Tabs */}
|
||||||
{tabs.map((tab) => (
|
<NavigationTabs
|
||||||
<button
|
tabs={equipmentTabs}
|
||||||
key={tab}
|
activeTab={activeTab}
|
||||||
onClick={() => setActiveTab(tab)}
|
onTabChange={setActiveTab}
|
||||||
className={`pb-3 relative transition-colors whitespace-nowrap ${
|
className="mb-6"
|
||||||
activeTab === tab
|
/>
|
||||||
? 'text-teal-400 border-b-2 border-teal-400 font-bold'
|
|
||||||
: 'text-slate-400 hover:text-slate-200'
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
{tab}
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* --- STAT CARDS --- */}
|
{/* --- STAT CARDS --- */}
|
||||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6">
|
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6">
|
||||||
{/* Total Equipment */}
|
{/* Total Equipment */}
|
||||||
|
|||||||
@@ -14,12 +14,13 @@ import Button from "@/utils/button";
|
|||||||
import StatCard from "@/utils/dashStatCard";
|
import StatCard from "@/utils/dashStatCard";
|
||||||
import LocationTable from '../../utils/table';
|
import LocationTable from '../../utils/table';
|
||||||
import NavigationTabs from '@/utils/tabs';
|
import NavigationTabs from '@/utils/tabs';
|
||||||
|
import { helpdeskTtabs } from '@/constants/constant';
|
||||||
|
|
||||||
|
|
||||||
export default function HelpDeskPortal() {
|
export default function HelpDeskPortal() {
|
||||||
const [activeTab, setActiveTab] = useState<string>('Location');
|
const [activeTab, setActiveTab] = useState<string>('Location');
|
||||||
|
|
||||||
const tabs: string[] = ['Location', 'Technical', 'Missed', 'Departments', 'HSQE'];
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="my-15 text-slate-100 max-w-7xl mx-auto font-sans">
|
<div className="my-15 text-slate-100 max-w-7xl mx-auto font-sans">
|
||||||
@@ -45,7 +46,7 @@ export default function HelpDeskPortal() {
|
|||||||
<div>
|
<div>
|
||||||
{/* Reusable Navigation Tabs */}
|
{/* Reusable Navigation Tabs */}
|
||||||
<NavigationTabs
|
<NavigationTabs
|
||||||
tabs={tabs}
|
tabs={helpdeskTtabs}
|
||||||
activeTab={activeTab}
|
activeTab={activeTab}
|
||||||
onTabChange={setActiveTab}
|
onTabChange={setActiveTab}
|
||||||
className="mb-6"
|
className="mb-6"
|
||||||
|
|||||||
@@ -13,7 +13,9 @@ import {
|
|||||||
|
|
||||||
// Import your custom Card components
|
// Import your custom Card components
|
||||||
import { Card } from "@/utils/cardWrapper";
|
import { Card } from "@/utils/cardWrapper";
|
||||||
import { CardHeader } from "@/utils/cardHeader";
|
import { CardHeader } from "@/utils/cardHeader";
|
||||||
|
|
||||||
|
|
||||||
export default function PropertyManagerPortal() {
|
export default function PropertyManagerPortal() {
|
||||||
return (
|
return (
|
||||||
<div className=" text-slate-100 mt-15
|
<div className=" text-slate-100 mt-15
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ import { Plus } from 'lucide-react';
|
|||||||
import Button from "@/utils/button";
|
import Button from "@/utils/button";
|
||||||
import LocationTable from '@/utils/table';
|
import LocationTable from '@/utils/table';
|
||||||
import NavigationTabs from '@/utils/tabs';
|
import NavigationTabs from '@/utils/tabs';
|
||||||
import { Reqeusttabs } from '@/constants/constant';
|
import { Reqeusttabs,statusFilters } from '@/constants/constant';
|
||||||
|
import FilterTabs from '@/utils/roundedFilters';
|
||||||
|
|
||||||
export default function ServiceRequestsPortal() {
|
export default function ServiceRequestsPortal() {
|
||||||
const [activeTab, setActiveTab] = useState<string>('TFM Requests');
|
const [activeTab, setActiveTab] = useState<string>('TFM Requests');
|
||||||
@@ -11,14 +12,7 @@ export default function ServiceRequestsPortal() {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
const statusFilters = [
|
|
||||||
{ label: 'All', count: 18 },
|
|
||||||
{ label: 'Registered', count: 4 },
|
|
||||||
{ label: 'Assigned', count: 3 },
|
|
||||||
{ label: 'Working', count: 4 },
|
|
||||||
{ label: 'Completed', count: 3 },
|
|
||||||
{ label: 'Overdue', count: 4 },
|
|
||||||
];
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="my-15 text-slate-100 max-w-7xl mx-auto font-sans">
|
<div className="my-15 text-slate-100 max-w-7xl mx-auto font-sans">
|
||||||
@@ -65,31 +59,11 @@ export default function ServiceRequestsPortal() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* --- STATUS PILL FILTERS --- */}
|
{/* --- STATUS PILL FILTERS --- */}
|
||||||
<div className="flex items-center gap-2.5 overflow-x-auto no-scrollbar py-1">
|
<FilterTabs
|
||||||
{statusFilters.map((filter) => {
|
options={statusFilters}
|
||||||
const isActive = activeFilter === filter.label;
|
activeFilter={activeFilter}
|
||||||
return (
|
onChange={setActiveFilter}
|
||||||
<button
|
/>
|
||||||
key={filter.label}
|
|
||||||
onClick={() => setActiveFilter(filter.label)}
|
|
||||||
className={`flex items-center gap-2 px-3.5 py-1.5 rounded-full text-xs font-medium transition-all ${
|
|
||||||
isActive
|
|
||||||
? 'bg-teal-950/40 text-teal-400 border border-teal-500/50'
|
|
||||||
: 'bg-[#0b1727] text-slate-400 border border-slate-800/80 hover:text-slate-200'
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
<span>{filter.label}</span>
|
|
||||||
<span
|
|
||||||
className={`font-mono text-[11px] ${
|
|
||||||
isActive ? 'text-teal-400 font-bold' : 'text-slate-400'
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
{filter.count}
|
|
||||||
</span>
|
|
||||||
</button>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</div>
|
|
||||||
<LocationTable/>
|
<LocationTable/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
|
||||||
|
import { TableRowData } from '@/constants/types';
|
||||||
import {
|
import {
|
||||||
LayoutGrid,
|
LayoutGrid,
|
||||||
Smile,
|
Smile,
|
||||||
@@ -202,4 +204,32 @@ export const Reqeusttabs: string[] = [
|
|||||||
'TFM Requests',
|
'TFM Requests',
|
||||||
'Engineering',
|
'Engineering',
|
||||||
'Schedule Complaints'
|
'Schedule Complaints'
|
||||||
|
];
|
||||||
|
|
||||||
|
export const statusFilters = [
|
||||||
|
{ label: 'All', count: 18 },
|
||||||
|
{ label: 'Registered', count: 4 },
|
||||||
|
{ label: 'Assigned', count: 3 },
|
||||||
|
{ label: 'Working', count: 4 },
|
||||||
|
{ label: 'Completed', count: 3 },
|
||||||
|
{ label: 'Overdue', count: 4 },
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Data model interface
|
||||||
|
|
||||||
|
|
||||||
|
// Sample data extracted from your screenshot
|
||||||
|
export const mockData: TableRowData[] = [
|
||||||
|
{ id: '1', block: 'Block 1', floor: 'G', zone: 'Z2', department: 'Electrical', location: 'Main lobby', window: '06:00–17:30', tat: '60m', sched: 8, approval: true, status: 'INACTIVE' },
|
||||||
|
{ id: '2', block: 'Block 2', floor: '3', zone: 'Z2', department: 'Electrical', location: 'Main lobby', window: '08:00–23:59', tat: '30m', sched: 4, approval: false, status: 'ACTIVE' },
|
||||||
|
{ id: '3', block: 'Block 2', floor: '3', zone: 'Z1', department: 'Inspection work', location: 'Cafeteria', window: '06:00–17:30', tat: '20m', sched: 8, approval: true, status: 'ACTIVE' },
|
||||||
|
{ id: '4', block: 'Block 1', floor: 'G', zone: 'Z1', department: 'HVAC', location: 'Server room', window: '08:00–18:00', tat: '30m', sched: 4, approval: false, status: 'INACTIVE' },
|
||||||
|
{ id: '5', block: 'Block 2', floor: '3', zone: 'N', department: 'Inspection work', location: 'Server room', window: '08:00–18:00', tat: '60m', sched: 8, approval: true, status: 'ACTIVE' },
|
||||||
|
{ id: '6', block: 'Block 2', floor: 'G', zone: 'Z1', department: 'Electrical', location: 'Reception', window: '06:00–18:00', tat: '60m', sched: 6, approval: false, status: 'ACTIVE' },
|
||||||
|
{ id: '7', block: 'Block 1', floor: 'G', zone: 'Z2', department: 'Electrical', location: 'Food court', window: '06:00–17:30', tat: '60m', sched: 8, approval: true, status: 'ACTIVE' },
|
||||||
|
{ id: '8', block: 'Block 2', floor: '3', zone: 'Z2', department: 'Electrical', location: 'Cafeteria', window: '08:00–23:59', tat: '30m', sched: 4, approval: false, status: 'ACTIVE' },
|
||||||
|
{ id: '9', block: 'Block 2', floor: '3', zone: 'Z1', department: 'Inspection work', location: 'Gym', window: '06:00–17:30', tat: '20m', sched: 8, approval: true, status: 'INACTIVE' },
|
||||||
|
{ id: '10', block: 'Block 1', floor: 'G', zone: 'Z1', department: 'HVAC', location: 'Lobby', window: '08:00–18:00', tat: '30m', sched: 4, approval: false, status: 'ACTIVE' },
|
||||||
];
|
];
|
||||||
@@ -17,6 +17,12 @@ export interface AuthLayoutProps {
|
|||||||
onForgotPassword?:()=>void;
|
onForgotPassword?:()=>void;
|
||||||
item?: any;
|
item?: any;
|
||||||
}
|
}
|
||||||
|
export interface ButtonProps {
|
||||||
|
children: React.ReactNode;
|
||||||
|
onClick?: () => void;
|
||||||
|
className?: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface FormProps {
|
export interface FormProps {
|
||||||
label: string;
|
label: string;
|
||||||
value?: string;
|
value?: string;
|
||||||
@@ -71,6 +77,26 @@ export interface StatusProgressProps {
|
|||||||
barColor?: string;
|
barColor?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export interface NavigationTabsProps {
|
||||||
|
tabs: string[];
|
||||||
|
activeTab: string;
|
||||||
|
onTabChange: (tab: string) => void;
|
||||||
|
className?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export interface FilterItem {
|
||||||
|
label: string;
|
||||||
|
count?: number | string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FilterTabsProps {
|
||||||
|
options: FilterItem[];
|
||||||
|
activeFilter: string;
|
||||||
|
onChange: (label: string) => void;
|
||||||
|
className?: string;
|
||||||
|
}
|
||||||
// For footer banner
|
// For footer banner
|
||||||
export interface InfoBannerProps {
|
export interface InfoBannerProps {
|
||||||
boldText?: string;
|
boldText?: string;
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
interface Props {
|
import { ButtonProps } from "@/constants/types";
|
||||||
children: React.ReactNode;
|
|
||||||
onClick?: () => void;
|
|
||||||
className?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function Button({
|
export default function Button({
|
||||||
children,
|
children,
|
||||||
onClick,
|
onClick,
|
||||||
className,
|
className,
|
||||||
}: Props) {
|
}: ButtonProps) {
|
||||||
return (
|
return (
|
||||||
<button onClick={onClick} className={className}>
|
<button onClick={onClick} className={className}>
|
||||||
{children}
|
{children}
|
||||||
|
|||||||
44
utils/roundedFilters.tsx
Normal file
44
utils/roundedFilters.tsx
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
import { FilterTabsProps } from "@/constants/types";
|
||||||
|
|
||||||
|
export default function FilterTabs({
|
||||||
|
options = [],
|
||||||
|
activeFilter,
|
||||||
|
onChange,
|
||||||
|
className = "",
|
||||||
|
}: FilterTabsProps) {
|
||||||
|
if (!Array.isArray(options) || options.length === 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={`flex items-center gap-2.5 overflow-x-auto no-scrollbar py-1 ${className}`}>
|
||||||
|
{options.map((filter) => {
|
||||||
|
const isActive = activeFilter === filter.label;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<button
|
||||||
|
key={filter.label}
|
||||||
|
type="button"
|
||||||
|
onClick={() => onChange(filter.label)}
|
||||||
|
className={`flex items-center gap-2 px-3.5 py-1.5 rounded-full text-xs font-medium transition-all whitespace-nowrap cursor-pointer ${
|
||||||
|
isActive
|
||||||
|
? "bg-teal-950/40 text-teal-400 border border-teal-500/50"
|
||||||
|
: "bg-[#0b1727] text-slate-400 border border-slate-800/80 hover:text-slate-200"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
<span>{filter.label}</span>
|
||||||
|
{filter.count !== undefined && (
|
||||||
|
<span
|
||||||
|
className={`font-mono text-[11px] ${
|
||||||
|
isActive ? "text-teal-400 font-bold" : "text-slate-400"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{filter.count}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import {
|
import {
|
||||||
Pencil,
|
Pencil,
|
||||||
Menu,
|
Menu,
|
||||||
@@ -8,35 +8,8 @@ import {
|
|||||||
Check,
|
Check,
|
||||||
Sparkles,
|
Sparkles,
|
||||||
} from 'lucide-react';
|
} from 'lucide-react';
|
||||||
|
import { mockData } from '@/constants/constant';
|
||||||
|
|
||||||
// Data model interface
|
|
||||||
interface TableRowData {
|
|
||||||
id: string;
|
|
||||||
block: string;
|
|
||||||
floor: string;
|
|
||||||
zone: string;
|
|
||||||
department: string;
|
|
||||||
location: string;
|
|
||||||
window: string;
|
|
||||||
tat: string;
|
|
||||||
sched: number;
|
|
||||||
approval: boolean;
|
|
||||||
status: 'ACTIVE' | 'INACTIVE';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sample data extracted from your screenshot
|
|
||||||
const mockData: TableRowData[] = [
|
|
||||||
{ id: '1', block: 'Block 1', floor: 'G', zone: 'Z2', department: 'Electrical', location: 'Main lobby', window: '06:00–17:30', tat: '60m', sched: 8, approval: true, status: 'INACTIVE' },
|
|
||||||
{ id: '2', block: 'Block 2', floor: '3', zone: 'Z2', department: 'Electrical', location: 'Main lobby', window: '08:00–23:59', tat: '30m', sched: 4, approval: false, status: 'ACTIVE' },
|
|
||||||
{ id: '3', block: 'Block 2', floor: '3', zone: 'Z1', department: 'Inspection work', location: 'Cafeteria', window: '06:00–17:30', tat: '20m', sched: 8, approval: true, status: 'ACTIVE' },
|
|
||||||
{ id: '4', block: 'Block 1', floor: 'G', zone: 'Z1', department: 'HVAC', location: 'Server room', window: '08:00–18:00', tat: '30m', sched: 4, approval: false, status: 'INACTIVE' },
|
|
||||||
{ id: '5', block: 'Block 2', floor: '3', zone: 'N', department: 'Inspection work', location: 'Server room', window: '08:00–18:00', tat: '60m', sched: 8, approval: true, status: 'ACTIVE' },
|
|
||||||
{ id: '6', block: 'Block 2', floor: 'G', zone: 'Z1', department: 'Electrical', location: 'Reception', window: '06:00–18:00', tat: '60m', sched: 6, approval: false, status: 'ACTIVE' },
|
|
||||||
{ id: '7', block: 'Block 1', floor: 'G', zone: 'Z2', department: 'Electrical', location: 'Food court', window: '06:00–17:30', tat: '60m', sched: 8, approval: true, status: 'ACTIVE' },
|
|
||||||
{ id: '8', block: 'Block 2', floor: '3', zone: 'Z2', department: 'Electrical', location: 'Cafeteria', window: '08:00–23:59', tat: '30m', sched: 4, approval: false, status: 'ACTIVE' },
|
|
||||||
{ id: '9', block: 'Block 2', floor: '3', zone: 'Z1', department: 'Inspection work', location: 'Gym', window: '06:00–17:30', tat: '20m', sched: 8, approval: true, status: 'INACTIVE' },
|
|
||||||
{ id: '10', block: 'Block 1', floor: 'G', zone: 'Z1', department: 'HVAC', location: 'Lobby', window: '08:00–18:00', tat: '30m', sched: 4, approval: false, status: 'ACTIVE' },
|
|
||||||
];
|
|
||||||
|
|
||||||
export default function LocationTable(){
|
export default function LocationTable(){
|
||||||
const [selectedIds, setSelectedIds] = useState<string[]>(['1']); // Row 1 selected by default (teal indicator bar)
|
const [selectedIds, setSelectedIds] = useState<string[]>(['1']); // Row 1 selected by default (teal indicator bar)
|
||||||
|
|||||||
@@ -1,12 +1,7 @@
|
|||||||
// @/utils/NavigationTabs.tsx
|
import { NavigationTabsProps } from "@/constants/types";
|
||||||
import React from 'react';
|
|
||||||
|
|
||||||
|
|
||||||
interface NavigationTabsProps {
|
|
||||||
tabs: string[];
|
|
||||||
activeTab: string;
|
|
||||||
onTabChange: (tab: string) => void;
|
|
||||||
className?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function NavigationTabs({
|
export default function NavigationTabs({
|
||||||
tabs,
|
tabs,
|
||||||
|
|||||||
Reference in New Issue
Block a user