Files
WearPartTracker/app/components/AlertBadge.tsx
Denis Urs Rudolph d37676f3c0 Feature: Kilometerstand-Feld für Fahrräder und verbesserte Warnungen
- currentMileage Feld zu Bike-Modell hinzugefügt
- calculateServiceStatus verwendet jetzt aktuellen Kilometerstand des Fahrrads
- Warnungen für überfällige Wartungen (OVERDUE Status)
- Rote Warnung bei überfälligen Teilen
- Kilometerstand wird in BikeDetail und BikeCard angezeigt
- AlertBadge unterstützt jetzt critical Variante
- Verbesserte Statusanzeige mit Überfällig-Hinweis
2025-12-05 22:37:10 +01:00

24 lines
539 B
TypeScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
interface AlertBadgeProps {
count: number
variant?: 'warning' | 'critical'
}
export default function AlertBadge({
count,
variant = 'warning',
}: AlertBadgeProps) {
if (count === 0) return null
const bgColor = variant === 'critical' ? 'bg-red-100' : 'bg-orange-100'
const textColor = variant === 'critical' ? 'text-red-800' : 'text-orange-800'
return (
<span
className={`inline-flex items-center px-3 py-1 rounded-full text-sm font-medium ${bgColor} ${textColor}`}
>
{count}
</span>
)
}