.cursor/skills/nazim-status-badges/SKILL.md
Enforces status badge patterns for Nazim UI. Use when displaying status in tables, cards, or dialogs. Covers Badge variants, semantic colors, statusBadgeVariant, statusOptions with color.
npx skillsauth add AHMADJAN-New/nazim-web nazim-status-badgesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use consistent badge variants and semantic colors for status display.
| Variant | Use For |
|---------|---------|
| default | Success/active (e.g. active, paid, pass) |
| secondary | Neutral (e.g. admitted, partial, under_review) |
| outline | Info/pending (e.g. applied, pending, draft) |
| destructive | Error/negative (e.g. withdrawn, overdue, fail) |
For simple status (student, staff, subscription):
const statusBadgeVariant = (status?: string) => {
switch (status) {
case 'active': return 'default';
case 'admitted': return 'secondary';
case 'applied': return 'outline';
case 'withdrawn': return 'destructive';
default: return 'outline';
}
};
<Badge variant={statusBadgeVariant(status)} className="capitalize">
{formatStatus(status)}
</Badge>
For attendance, fees, or statuses needing semantic colors:
const statusOptions = [
{ value: 'present', label: t('present'), icon: CheckCircle2, color: 'bg-green-100 text-green-700 border-green-300 dark:bg-green-950 dark:text-green-400' },
{ value: 'absent', label: t('absent'), icon: XCircle, color: 'bg-red-100 text-red-700 border-red-300 dark:bg-red-950 dark:text-red-400' },
{ value: 'late', label: t('late'), icon: Clock, color: 'bg-yellow-100 text-yellow-700 border-yellow-300 dark:bg-yellow-950 dark:text-yellow-400' },
{ value: 'excused', label: t('excused'), icon: AlertCircle, color: 'bg-blue-100 text-blue-700 border-blue-300 dark:bg-blue-950 dark:text-blue-400' },
];
const option = statusOptions.find(opt => opt.value === status);
if (!option) return <Badge variant="outline">{status}</Badge>;
<Badge variant="outline" className={`${option.color} flex items-center gap-1.5 font-medium w-fit`}>
<Icon className="h-3.5 w-3.5" />
{option.label}
</Badge>
| Meaning | Light | Dark |
|---------|-------|------|
| Success | bg-green-100 text-green-700 | dark:bg-green-950 dark:text-green-400 |
| Error | bg-red-100 text-red-700 | dark:bg-red-950 dark:text-red-400 |
| Warning | bg-yellow-100 text-yellow-700 | dark:bg-yellow-950 dark:text-yellow-400 |
| Pending | bg-orange-100 text-orange-700 | dark:bg-orange-950 dark:text-orange-400 |
| Info | bg-blue-100 text-blue-700 | dark:bg-blue-950 dark:text-blue-400 |
| Special | bg-purple-100 text-purple-700 | dark:bg-purple-950 dark:text-purple-400 |
const variants: Record<string, 'default' | 'secondary' | 'destructive' | 'outline'> = {
paid: 'default',
partial: 'secondary',
pending: 'outline',
overdue: 'destructive',
};
const colors: Record<string, string> = {
paid: 'bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400',
partial: 'bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400',
pending: 'bg-orange-100 text-orange-800 dark:bg-orange-900/30 dark:text-orange-400',
overdue: 'bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400',
};
<Badge className={colors[status] || ''} variant={variants[status] || 'outline'}>
variant="outline" for unknown statusw-fit when badge is in table celltools
Toast notifications for Nazim. Use when showing success/error/info messages. ALWAYS use showToast from @/lib/toast with translation keys; never toast from sonner directly. RTL positioning is automatic.
development
Enforces mobile-first responsive patterns for Nazim UI. Use when building pages, tables, forms, charts, or buttons. Covers page container, FilterPanel, tabs, grids, tables, charts, cards, buttons.
development
PDF and Excel report generation for Nazim. Use when adding or changing reports. Backend uses ReportService and ReportConfig; frontend uses useServerReport. Covers branding, DateConversionService, RTL, acceptance criteria.
development
Enforces patterns for creating and maintaining platform admin pages in Nazim. Use when adding new platform management pages, routes, or API endpoints. Covers 5-step checklist, platformApi, usePlatformAdminPermissions, no organization_id.