/** * Product Display Section * Controls for toggling product image, title, price, and button text * inside back-in-stock (or similar product-oriented) email templates. */ import { Label } from '@/components/ui/label'; import { Input } from '@/components/ui/input'; import { Switch } from '@/components/ui/switch'; import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from '@/components/ui/collapsible'; import { ChevronDown, Package } from 'lucide-react'; import { useState } from 'react'; export interface ProductCardConfig { showImage: boolean; showTitle: boolean; showPrice: boolean; buttonText: string; /** Sample data rendered in the email preview. */ sample: { name: string; price: string; imageUrl: string; productUrl: string; }; } interface ProductDisplaySectionProps { productCard: ProductCardConfig; onUpdate: (updates: Partial) => void; } export function ProductDisplaySection({ productCard, onUpdate, }: ProductDisplaySectionProps) { const [isOpen, setIsOpen] = useState(true); return (
Product Display

Product card in email

{/* Show Product Image */}

Show the product image in the email

onUpdate({ showImage: v })} />
{/* Show Product Title */}

Show the product name in the email

onUpdate({ showTitle: v })} />
{/* Show Product Price */}

Show the product price in the email

onUpdate({ showPrice: v })} />
{/* Button Text */}
onUpdate({ buttonText: e.target.value })} placeholder="Shop Now" />

The call-to-action button shown below the product

); } export default ProductDisplaySection;