import type { HTMLAttributes, ReactNode } from "react"; import { translateReactNode, usePlatformLanguage } from "../i18n/LanguageContext"; export type FormSectionVariant = "plain" | "separated" | "panel"; export type FormSectionProps = HTMLAttributes & { children: ReactNode; title?: ReactNode; description?: ReactNode; actions?: ReactNode; variant?: FormSectionVariant; contentClassName?: string; }; export default function FormSection({ children, title, description, actions, variant = "plain", className = "", contentClassName = "", ...props }: FormSectionProps) { const { translateText } = usePlatformLanguage(); return (
{(title || description || actions) && (
{title &&

{translateReactNode(title, translateText)}

} {description &&
{translateReactNode(description, translateText)}
}
{actions &&
{translateReactNode(actions, translateText)}
}
)}
{children}
); }