import React from 'react'; interface Props { label: string; htmlFor?: string; error?: string; className?: string; style?: React.CSSProperties; children: React.ReactNode; } /** * چیدمان یک فیلد فرم: برچسب بالا، کنترل (children)، و پیام خطای زیر آن. * presentational — منطق فرم/ولیدیشن بیرون از این کامپوننت است. */ export default function Field({ label, htmlFor, error, className, style, children }: Props) { return (
{children} {error && ( {error} )}
); }