'use client'; import { Shipping } from 'lib/woocomerce/models/shipping'; import { useState } from 'react'; export default function ShippingForm({ title, handleChangeAction }: { title: string; handleChangeAction?: (data: Shipping) => void; }) { const initialState: Shipping = { first_name: '', last_name: '', address_1: '', address_2: '', city: '', state: '', postcode: '', country: '', company: '' }; const [formData, setFormData] = useState(initialState); const onChange = (e: React.ChangeEvent) => { const newData = { ...formData, [e.target.name]: e.target.value }; setFormData(newData); if (handleChangeAction) { handleChangeAction(newData); } }; return (

{title}

); }