import React from 'react'; import type { PageContentType } from '../../service/visibility/visibility.interface'; import { contentTypeLabel, contentTypeTone, toneToBadgeClass } from './helpers'; import Modal from './Modal'; /** Props for {@link PageTemplateDetailModal}. */ interface PageTemplateDetailModalProps { open: boolean; onClose: () => void; name: string; description: string; /** Who authored the brief: "Recomaze" for presets, the merchant otherwise. */ creator: string; /** When true, render the Recomaze logo next to the creator name. */ creatorIsRecomaze: boolean; /** Free-text category shown next to the creator. */ category: string; contentType: PageContentType; /** Presets have no delete; merchant templates do. */ canDelete: boolean; onRun: () => void; onModify: () => void; onDelete: () => void; } /** * Detail card opened when a gallery template is clicked. Mirrors the Profound * template modal: a banner, the name + description, the creator and category, * and Run / Modify actions (plus Delete for merchant-owned templates). * * @param {PageTemplateDetailModalProps} props - Modal props. * @returns {JSX.Element} The modal. */ const PageTemplateDetailModal = ({ open, onClose, name, description, creator, creatorIsRecomaze, category, contentType, canDelete, onRun, onModify, onDelete, }: PageTemplateDetailModalProps): JSX.Element | null => { return ( {canDelete && ( )} } >

{name}

{contentTypeLabel(contentType)}
{description ? (

{description}

) : null}
Creator
{creatorIsRecomaze ? ( Recomaze ) : null}

{creator}

Category

{category}

); }; export default PageTemplateDetailModal;