import { Document, Page, Text, View, Image, StyleSheet } from "@react-pdf/renderer"; import type { ProtokollProps } from "./protokoll"; const styles = StyleSheet.create({ page: { padding: 32, fontSize: 11 }, h1: { fontSize: 16, marginBottom: 12, fontWeight: 700 }, row: { flexDirection: "row", justifyContent: "space-between", marginBottom: 4 }, fotoGrid: { flexDirection: "row", flexWrap: "wrap", gap: 8, marginTop: 12 }, foto: { width: 120, marginBottom: 8 }, fotoImg: { width: 120, height: 90, objectFit: "cover" }, fotoLabel: { fontSize: 9, marginTop: 2 }, unterschrift: { width: 200, height: 80, marginTop: 8, borderWidth: 1, borderColor: "#ccc" }, }); export function ProtokollDocument({ props }: { props: ProtokollProps }) { return ( Übergabeprotokoll {props.auftragsnummer} Fahrzeug {props.fahrzeugKennzeichen} Abholort {props.abholort.adresse} ({props.abholort.ansprechpartner}) Zielort {props.zielort.adresse} ({props.zielort.ansprechpartner}) Start-KM {props.startKm ?? "-"} End-KM {props.endKm ?? "-"} Übergabe bestätigt {props.uebergabeBestaetigtAt ?? "-"} Empfänger {props.empfaengerName ?? "-"} {props.fotos.length > 0 && ( {props.fotos.map((foto, index) => ( {foto.label} {foto.beschreibung ? `: ${foto.beschreibung}` : ""} ))} )} {props.unterschriftBuffer && ( <> Unterschrift )} ); }