feat: Unterschriften bei Logbuchänderungen invalidieren

Änderungen am Eintrag (außer Fotos) entfernen Skipper- und Crew-Signaturen
automatisch. Vor dem Unterschreiben erscheinen Hinweis-Banner und Bestätigung.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-29 16:45:02 +02:00
parent 878a18e9f7
commit 81da01e786
7 changed files with 129 additions and 6 deletions
+10 -2
View File
@@ -10,6 +10,7 @@ interface SignaturePadProps {
onChange: (value: string) => void
disabled?: boolean
readOnly?: boolean
onBeforeSign?: () => Promise<boolean> | boolean
}
const STROKE_COLOR = '#0f172a'
@@ -21,7 +22,8 @@ export default function SignaturePad({
value,
onChange,
disabled = false,
readOnly = false
readOnly = false,
onBeforeSign
}: SignaturePadProps) {
const { t } = useTranslation()
const containerRef = useRef<HTMLDivElement>(null)
@@ -138,9 +140,15 @@ export default function SignaturePad({
onChange(canvas.toDataURL('image/png'))
}
const handlePointerDown = (event: React.PointerEvent<HTMLCanvasElement>) => {
const handlePointerDown = async (event: React.PointerEvent<HTMLCanvasElement>) => {
if (readOnly || disabled) return
event.preventDefault()
if (!value && !hasInk.current && onBeforeSign) {
const allowed = await onBeforeSign()
if (!allowed) return
}
const point = getPoint(event)
if (!point) return