import { useFormContext } from 'react-hook-form' import { CampoNumero, CampoTexto } from '../components/Campos' import SectionCard from '../components/SectionCard' import { formatoMoneda } from '../lib/formatters' interface Props { prefix: string } /** Campos de datos económicos con totales calculados de solo lectura */ export default function EconomicosCampos({ prefix }: Props) { const { watch } = useFormContext() const p = (campo: string) => `${prefix}${campo}` const ingresosMensuales = Number(watch(p('ingresosMensuales'))) || 0 const otrosIngresos = Number(watch(p('otrosIngresos'))) || 0 const gastosLuz = Number(watch(p('gastosLuz'))) || 0 const gastosOtros = Number(watch(p('gastosOtros'))) || 0 return ( ) }