Files
tfm_ainventory/frontend/components/StatCard.tsx
Daniel Bedeleanu 89a69a3ec9 refactor(frontend): audit fixes - accessibility, colors, and UX
Accessibility:
- Add focus-visible indicators to all interactive elements (buttons, inputs)
- Create accessible CreateUserModal to replace window.prompt()
- Add aria-labels to icon buttons for screen readers

Colors & Theming:
- Move primary color to CSS variable (--primary)
- Remove hard-coded #3b82f6 from tailwind config
- Clean up color consistency across theme

UX:
- Replace prompt-based user creation with proper modal form
- Implement inline field validation with error messages
- Add loading state during form submission
- Improve visual hierarchy and spacing

Performance:
- Remove bootstrap-icons dependency (duplicate with lucide-react)

Design:
- Reduce backdrop-blur overuse (remove from overlay scrim, StatCard)
- Improve AdminOverlay responsive design
2026-04-17 10:12:53 +03:00

26 lines
862 B
TypeScript

import React from 'react';
import { LucideIcon } from 'lucide-react';
interface StatCardProps {
label: string;
value: number;
icon?: LucideIcon;
}
export default function StatCard({ label, value, icon: Icon }: StatCardProps) {
return (
<div className="flex justify-between items-center gap-2 p-3.5 bg-slate-900/50 border border-slate-800/50 rounded-2xl shadow-sm transition-all hover:bg-slate-900/80" role="status">
<div className="flex items-center gap-2.5 min-w-0">
{Icon && <Icon className="w-5 h-5 text-primary flex-shrink-0" aria-hidden="true" />}
<span className="text-base md:text-lg text-slate-300 font-semibold truncate">
{label}
</span>
</div>
<span className="text-2xl md:text-3xl font-black text-white whitespace-nowrap tabular-nums">
{value}
</span>
</div>
);
}