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
This commit is contained in:
Denis Urs Rudolph
2025-12-05 22:36:58 +01:00
parent 81edc206e0
commit d37676f3c0
10 changed files with 134 additions and 44 deletions

View File

@@ -14,6 +14,7 @@ export default function BikeForm({ onSuccess, onCancel }: BikeFormProps) {
brand: '',
model: '',
purchaseDate: '',
currentMileage: 0,
notes: '',
})
const [errors, setErrors] = useState<Record<string, string>>({})
@@ -45,6 +46,7 @@ export default function BikeForm({ onSuccess, onCancel }: BikeFormProps) {
brand: '',
model: '',
purchaseDate: '',
currentMileage: 0,
notes: '',
})
} else {
@@ -131,18 +133,38 @@ export default function BikeForm({ onSuccess, onCancel }: BikeFormProps) {
</div>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-1">
Kaufdatum
</label>
<input
type="date"
value={formData.purchaseDate}
onChange={(e) =>
setFormData({ ...formData, purchaseDate: e.target.value })
}
className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent text-black"
/>
<div className="grid grid-cols-2 gap-4">
<div>
<label className="block text-sm font-medium text-gray-700 mb-1">
Kaufdatum
</label>
<input
type="date"
value={formData.purchaseDate}
onChange={(e) =>
setFormData({ ...formData, purchaseDate: e.target.value })
}
className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent text-black"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-1">
Aktueller Kilometerstand (km)
</label>
<input
type="number"
value={formData.currentMileage}
onChange={(e) =>
setFormData({
...formData,
currentMileage: Number(e.target.value) || 0,
})
}
min="0"
className="w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent text-black"
/>
</div>
</div>
<div>