Files
KAFM-Project/types/types.ts

123 lines
2.3 KiB
TypeScript

import { LucideProps } from "lucide-react";
import { ComponentType } from "react";
import { colorMap } from "../constants/constant";
// Types and interfaces used in login Page
export type Step = "login" | "verify" | "forgot";
export interface AuthLayoutProps {
children: React.ReactNode;
}
export interface Props {
onBack?: () => void;
onSuccess?: () => void;
onForgotPassword?:()=>void;
item?: any;
}
export interface ButtonProps {
children: React.ReactNode;
onClick?: () => void;
className?: string;
}
export interface FormProps {
label: string;
value?: string;
type?: string;
placeholder?:string
}
// Overview dashboard interface used
interface Activity {
time: string;
text: string;
boldText: string;
}
export interface ActivityFeedProps {
activities: Activity[];
}
export interface ChartItem {
month: string;
height: string;
}
export interface BarChartProps {
data: ChartItem[];
}
export interface StatCardProps {
// Common Fields
title: string;
value: string | number;
variant?: "progress" | "icon";
subtitle?: string;
progress?: number;
color?: keyof typeof colorMap;
icon?: ComponentType<LucideProps>;
badgeText?: string;
badgeClassName?: string;
iconContainerClassName?: string;
isActiveCard?: boolean;
}
export interface ProgressBarProps {
label: string;
value: number;
maxValue: number;
}
export interface StatusProgressProps {
label: string;
value: number;
total: number;
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
export interface InfoBannerProps {
boldText?: string;
normalText?: string;
}
export 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';
}
export type TableProps = {
headers: string[];
rows: React.ReactNode[][];
};