/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */ /* eslint-disable @typescript-eslint/no-unsafe-return */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ /* eslint-disable @typescript-eslint/no-explicit-any */ import { useEffect, useState } from 'react' import { TextAreaInput } from '#components/Input' import { MarkdownHint } from './MarkdownHint' import type { FormState } from '#types/FormState' export const ProfileTextForm = ({ state, setState, // Is this really used? dataField, heading, size, hideInputLabel, required, }: { state: FormState setState: React.Dispatch> dataField?: string heading: string size: string hideInputLabel: boolean required?: boolean }) => { const [field, setField] = useState(dataField || 'text') useEffect(() => { if (!dataField) { setField('text') } }, [dataField]) return (
setState((prevState) => ({ ...prevState, [field]: v, })) } labelStyle={hideInputLabel ? 'tw:hidden' : ''} containerStyle={size === 'full' ? 'tw:grow tw:h-full' : ''} inputStyle={size === 'full' ? 'tw:h-full' : 'tw:h-24'} required={required} />
) }