"use client"; import { memo } from "react"; import { getAssetPath } from "../../../../../lib/assetUtils"; import InputWithCounter from "../../../../components/controls/InputWithCounter"; import TextArea from "../../../../components/controls/TextArea"; import TextInput from "../../../../components/controls/TextInput"; import Upload from "../../../../components/controls/Upload"; import IncrementerBlock from "../../../../components/controls/IncrementerBlock"; import InputLabel from "../../../../components/type/InputLabel"; import ApplicableScopeField from "../ApplicableScopeField"; import { CUSTOM_METHOD_CARD_WIZARD_MAX_FIELD_CHARS } from "../../../../../lib/create/customMethodCardWizardConstants"; import type { CustomMethodCardWizardFieldBodiesViewProps } from "./CustomMethodCardWizard.types"; const TEXT_PLACEHOLDER_MAX = 8000; function CustomMethodCardWizardFieldBodiesViewComponent({ fieldType, copy, textBlockTitle, textPlaceholderBody, onTextBlockTitleChange, onTextPlaceholderBodyChange, badgeBlockTitle, badgeOptions, onBadgeBlockTitleChange, onBadgeAddOption, uploadBlockTitle, onUploadBlockTitleChange, fileInputRef, onFileChosen, onClearPendingUpload, uploadAssetPreviewUrl = null, uploadPersisting = false, uploadBusyHint, uploadErrorMessage = null, proportionBlockTitle, proportionDefault, onProportionBlockTitleChange, onProportionDefaultChange, }: CustomMethodCardWizardFieldBodiesViewProps) { const uploadPreviewTrimmed = uploadAssetPreviewUrl?.trim() ?? ""; const hasUploadPreview = uploadPreviewTrimmed.length > 0; if (fieldType === "text") { return (