import React from "react"; import { View } from "react-native"; import Animated from "react-native-reanimated"; import { Label } from "../components/text"; import { type useShakeAnimation } from "../hooks/useShakeAnimation"; type ShakeControl = ReturnType; interface ShakeFieldProps { shake: ShakeControl; label?: string; children: React.ReactNode; flashRadius?: number; /** When `false`, only the red flash runs — no rotation. Defaults to `true`. */ rotate?: boolean; } /** * Wraps a form field so it can shake + flash red when validation fails. * The label renders outside the shake wrapper so only the input rocks. */ export default function ShakeField({ shake, label, children, flashRadius = 8, rotate = true, }: ShakeFieldProps) { return ( {label ? : null} {children} ); }