import * as React from 'react' import { TextAreaInput } from '../../Input' import { FormState } from '../Templates/OnepagerForm' import { getValue } from '../../../Utils/GetValue' import { useEffect, useState } from 'react' export const ProfileTextForm = ({ state, setState, dataField, heading, size, hideInputLabel, }: { state: FormState setState: React.Dispatch> dataField?: string heading: string size: string hideInputLabel: 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'} />
) }