"use client"; /** * Controlled field blocks for wizard-authored method cards in Create modals * (facet screens + final-review chip edit). When `onBlocksChange` is omitted, * blocks render read-only (disabled controls). * * Layout matches preset method editors ({@link CommunicationMethodEditFields}, * {@link DecisionApproachEditFields}): {@link ModalTextAreaField}, * {@link ApplicableScopeField} chip rows, {@link IncrementerBlock}. */ import { memo, useCallback } from "react"; import { useMessages } from "../../../../contexts/MessagesContext"; import { CustomMethodCardFieldBlocksSummaryView } from "./CustomMethodCardFieldBlocksSummary.view"; import type { CustomMethodCardFieldBlocksSummaryProps } from "./CustomMethodCardFieldBlocksSummary.types"; function CustomMethodCardFieldBlocksSummaryContainerComponent({ blocks, onBlocksChange, }: CustomMethodCardFieldBlocksSummaryProps) { const m = useMessages(); const wiz = m.create.customRule.customMethodCardWizard; const fm = wiz.fieldModals; const em = wiz.editModal; const readOnly = !onBlocksChange; const onPatch = useCallback( (next: Parameters>[0]) => { onBlocksChange?.(next); }, [onBlocksChange], ); return ( ); } const CustomMethodCardFieldBlocksSummary = memo( CustomMethodCardFieldBlocksSummaryContainerComponent, ); CustomMethodCardFieldBlocksSummary.displayName = "CustomMethodCardFieldBlocksSummary"; export default CustomMethodCardFieldBlocksSummary;