{Object.entries(sections).map(([section, sectionFields]) => (
{section}
{sectionFields.map(field => (
{field.type === 'text' && (
onChange(field.key, e.target.value)}
disabled={readOnly}
/>
)}
{field.type === 'textarea' && (
))}
))}
);
}
```
#### 2.2 Hook System for Field Registration
**Create: `admin-spa/src/hooks/useMetaFields.ts`**
```tsx
interface MetaFieldsRegistry {
orders: MetaField[];
products: MetaField[];
}
// Global registry (can be extended by plugins via window object)
declare global {
interface Window {
WooNooWMetaFields?: MetaFieldsRegistry;
}
}
export function useMetaFields(type: 'orders' | 'products'): MetaField[] {
const [fields, setFields] = useState