Changes done in ui screens
This commit is contained in:
@@ -5,6 +5,8 @@ import { permitsData, workPermitFilters } from '@/constants/constant';
|
||||
import FilterTabs from '@/components/common/roundedFilters';
|
||||
import StatCard from '@/components/common/dashStatCard';
|
||||
import InfoBanner from '@/components/common/infoBanner';
|
||||
import Table from '@/components/common/dataTable';
|
||||
import { workPermitHeaders, workPermitRows } from '@/constants/tabledata';
|
||||
|
||||
export default function WorkPermitPortal() {
|
||||
|
||||
@@ -13,61 +15,7 @@ export default function WorkPermitPortal() {
|
||||
// Permit Data matching the UI
|
||||
|
||||
|
||||
const renderStatusBadge = (status: string) => {
|
||||
switch (status) {
|
||||
case "ACTIVE":
|
||||
return (
|
||||
<span className="inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-[10px] font-bold tracking-wider bg-emerald-950/60 text-emerald-400 border border-emerald-800/40">
|
||||
<span className="w-1.5 h-1.5 rounded-full bg-emerald-400"></span>
|
||||
ACTIVE
|
||||
</span>
|
||||
);
|
||||
case "SUBMITTED":
|
||||
return (
|
||||
<span className="inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-[10px] font-bold tracking-wider bg-amber-950/50 text-amber-300 border border-amber-800/40">
|
||||
<span className="w-1.5 h-1.5 rounded-full bg-amber-400"></span>
|
||||
SUBMITTED
|
||||
</span>
|
||||
);
|
||||
case "APPROVED":
|
||||
return (
|
||||
<span className="inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-[10px] font-bold tracking-wider bg-blue-950/60 text-blue-400 border border-blue-800/40">
|
||||
<span className="w-1.5 h-1.5 rounded-full bg-blue-400"></span>
|
||||
APPROVED
|
||||
</span>
|
||||
);
|
||||
case "EXPIRED":
|
||||
return (
|
||||
<span className="inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-[10px] font-bold tracking-wider bg-rose-950/40 text-rose-400 border border-rose-900/30">
|
||||
<span className="w-1.5 h-1.5 rounded-full bg-rose-400"></span>
|
||||
EXPIRED
|
||||
</span>
|
||||
);
|
||||
case "CLOSED":
|
||||
return (
|
||||
<span className="inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-[10px] font-bold tracking-wider bg-slate-800/80 text-slate-400 border border-slate-700/50">
|
||||
<span className="w-1.5 h-1.5 rounded-full bg-slate-400"></span>
|
||||
CLOSED
|
||||
</span>
|
||||
);
|
||||
case "REJECTED":
|
||||
return (
|
||||
<span className="inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-[10px] font-bold tracking-wider bg-rose-950/40 text-rose-400 border border-rose-900/30">
|
||||
<span className="w-1.5 h-1.5 rounded-full bg-rose-400"></span>
|
||||
REJECTED
|
||||
</span>
|
||||
);
|
||||
case "DRAFT":
|
||||
return (
|
||||
<span className="inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-[10px] font-bold tracking-wider bg-slate-800/80 text-slate-400 border border-slate-700/50">
|
||||
<span className="w-1.5 h-1.5 rounded-full bg-slate-400"></span>
|
||||
DRAFT
|
||||
</span>
|
||||
);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<div className="my-15 text-slate-100 font-sans">
|
||||
@@ -103,10 +51,7 @@ export default function WorkPermitPortal() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* --- NAVIGATION TABS & TOP ACTION BUTTONS --- */}
|
||||
<div className="flex flex-col md:flex-row md:items-center justify-between border-b border-slate-800/80 mb-6 gap-4">
|
||||
{/* Navigation tabs component if needed */}
|
||||
</div>
|
||||
|
||||
|
||||
{/* --- STAT CARDS --- */}
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6">
|
||||
@@ -166,94 +111,7 @@ export default function WorkPermitPortal() {
|
||||
|
||||
{/* --- PERMIT TABLE SECTION --- */}
|
||||
<div className="bg-[#0b1329] border border-slate-800/80 rounded-lg overflow-x-auto">
|
||||
<table className="w-full text-left text-sm">
|
||||
<thead>
|
||||
<tr className="border-b border-slate-800/80 text-[11px] font-bold uppercase tracking-wider text-slate-400">
|
||||
<th className="py-3 px-4">Permit</th>
|
||||
<th className="py-3 px-4">Working Type</th>
|
||||
<th className="py-3 px-4">Location</th>
|
||||
<th className="py-3 px-4">Contractor</th>
|
||||
<th className="py-3 px-4">Validity</th>
|
||||
<th className="py-3 px-4">Crew</th>
|
||||
<th className="py-3 px-4">Status</th>
|
||||
<th className="py-3 px-4 text-right"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody className="divide-y divide-slate-800/40">
|
||||
{permitsData.map((row, index) => (
|
||||
<tr
|
||||
key={index}
|
||||
className={`transition-colors relative ${
|
||||
row.isHighlighted ? "bg-[#0e2238]" : "hover:bg-slate-800/30"
|
||||
}`}
|
||||
>
|
||||
{/* Permit ID */}
|
||||
<td className="py-4 px-4 font-mono text-teal-400 font-medium text-xs whitespace-nowrap relative">
|
||||
{row.isHighlighted && (
|
||||
<div className="absolute left-0 top-0 bottom-0 w-[3px] bg-teal-400" />
|
||||
)}
|
||||
{row.permit}
|
||||
</td>
|
||||
|
||||
{/* Working Type */}
|
||||
<td className="py-4 px-4 font-semibold text-slate-100 whitespace-nowrap">
|
||||
{row.workingType}
|
||||
</td>
|
||||
|
||||
{/* Location */}
|
||||
<td className="py-4 px-4 text-slate-300 font-medium whitespace-nowrap">
|
||||
{row.location}
|
||||
</td>
|
||||
|
||||
{/* Contractor */}
|
||||
<td className="py-4 px-4 text-slate-300 font-medium whitespace-nowrap">
|
||||
{row.contractor}
|
||||
</td>
|
||||
|
||||
{/* Validity */}
|
||||
<td className="py-4 px-4 whitespace-nowrap">
|
||||
<div className="text-xs text-slate-300 font-medium">{row.validityDate}</div>
|
||||
<div className="text-[11px] font-mono text-slate-500">{row.validityTime}</div>
|
||||
</td>
|
||||
|
||||
{/* Crew */}
|
||||
<td className="py-4 px-4 text-slate-300 font-medium whitespace-nowrap">
|
||||
{row.crew}
|
||||
</td>
|
||||
|
||||
{/* Status Badge */}
|
||||
<td className="py-4 px-4 whitespace-nowrap">
|
||||
{renderStatusBadge(row.status)}
|
||||
</td>
|
||||
|
||||
{/* Actions */}
|
||||
<td className="py-4 px-4 text-right whitespace-nowrap">
|
||||
<div className="flex items-center justify-end gap-2">
|
||||
{row.hasViewIconOnly ? (
|
||||
<div className="flex flex-col gap-1">
|
||||
<button className="p-1.5 text-slate-400 hover:text-white bg-slate-800/40 hover:bg-slate-800 rounded border border-slate-700/50 transition-colors">
|
||||
<FileText size={14} />
|
||||
</button>
|
||||
<button className="p-1.5 text-slate-400 hover:text-white bg-slate-800/40 hover:bg-slate-800 rounded border border-slate-700/50 transition-colors">
|
||||
<Eye size={14} />
|
||||
</button>
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex flex-col items-center gap-1">
|
||||
<button className="p-1.5 text-slate-400 hover:text-white bg-slate-800/40 hover:bg-slate-800 rounded border border-slate-700/50 transition-colors">
|
||||
<FileText size={14} />
|
||||
</button>
|
||||
<button className="text-teal-400 hover:text-teal-300 text-xs font-semibold hover:underline">
|
||||
{row.actionText}
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
<Table headers={workPermitHeaders} rows={workPermitRows}/>
|
||||
</div>
|
||||
|
||||
<div className="mb-10 mt-10">
|
||||
|
||||
Reference in New Issue
Block a user