import { Link } from 'react-router-dom'; import { useAuth } from '../../contexts/AuthContext'; import { MOCK_BUGS, MOCK_STAFF_POSTS, MOCK_USERS, MOCK_THREADS } from '../../data/mockData'; interface StatCardProps { label: string; value: number | string; accent?: 'green' | 'amber' | 'red'; } function StatCard({ label, value, accent = 'green' }: StatCardProps) { const colors = { green: 'var(--color-green)', amber: 'var(--color-amber)', red: 'var(--color-red)', }; return (
{label}
{value}
); } interface NavTileProps { to: string; label: string; description: string; icon: string; } function NavTile({ to, label, description, icon }: NavTileProps) { return ( { (e.currentTarget as HTMLAnchorElement).style.borderColor = 'rgba(255,176,0,0.4)'; (e.currentTarget as HTMLAnchorElement).style.background = 'rgba(255,176,0,0.03)'; }} onMouseLeave={(e) => { (e.currentTarget as HTMLAnchorElement).style.borderColor = '#1a2a1a'; (e.currentTarget as HTMLAnchorElement).style.background = '#0a0d0a'; }} >
{icon}
{label}
{description}
); } export default function IntranetDashboard() { const { user } = useAuth(); const openBugs = MOCK_BUGS.filter((b) => b.status === 'open').length; const criticalBugs = MOCK_BUGS.filter((b) => b.severity === 'critical').length; const assignedToMe = MOCK_BUGS.filter((b) => b.assignedToId === user?.id).length; const totalUsers = MOCK_USERS.filter((u) => !u.isAdmin).length; return (
{/* Header */}
INTRANET / DASHBOARD

Welcome, {user?.username}

{new Date().toLocaleString('en-US', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', hour: '2-digit', minute: '2-digit' })}
{/* Stats */}
QUICK STATS
p.createdAt.startsWith('2026-02-18')).length} accent="amber" />
{/* Navigation tiles */}
SECTIONS
{/* Recent staff posts */}
RECENT TEAM ACTIVITY
{MOCK_STAFF_POSTS.slice(0, 4).map((post, idx) => (
{post.authorName} [{post.authorRole}] {new Date(post.createdAt).toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit' })}
{post.content}
))}
); }