FEAT-6: wire tab content into animal detail (Fotos/Gesundheit/Gewicht) + profile photo in header + tab styles

This commit is contained in:
2026-06-06 00:28:31 +02:00
parent 87250ba007
commit cd4328cef8
3 changed files with 169 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
/**
* FEAT-6: Profilfoto im Detail-Kopf — erstes Foto nach sortOrder.
* Selbstständig ladend; rendert nichts, solange es keine Fotos gibt
* (oder die Foto-Endpunkte noch nicht live sind).
*/
import { listGerbilPhotos, photoSrc, profilePhoto } from '../api/photos'
import { useApi } from '../hooks/useApi'
export default function GerbilProfilePhoto({ gerbilId }: { gerbilId: string }) {
const photos = useApi(() => listGerbilPhotos(gerbilId), [gerbilId])
const profile = profilePhoto(photos.data ?? [])
if (!profile) return null
return (
<img
className="profile-photo"
src={photoSrc(profile)}
alt={profile.caption ?? profile.fileName}
/>
)
}