import React from 'react'; import { X, Zap, FileText, Clock, AlertTriangle, Film } from 'lucide-react'; import { ExpressScene, DesignMD, CompanyProfile } from '../../../types'; interface SegmentCardProps { scene: ExpressScene; position: 'before' | 'after'; designMD: DesignMD; previewBrand: CompanyProfile | null; onSourceChange: (source: 'brand' | 'form') => void; onDurationChange: (seconds: number) => void; onLabelChange: (label: string) => void; onRequiredChange: (required: boolean) => void; onTransitionChange: (type: string) => void; onRemove: () => void; } const TRANSITION_OPTIONS = [ { value: 'none', label: 'Sin transición' }, { value: 'fade', label: 'Fundido' }, { value: 'slideUp', label: 'Deslizar ↑' }, { value: 'slideDown', label: 'Deslizar ↓' }, { value: 'slideLeft', label: 'Deslizar ←' }, { value: 'slideRight', label: 'Deslizar →' }, { value: 'scale', label: 'Escala' }, ]; /** * SegmentCard — Visual card for an intro/outro segment in the SceneComposer. * * Shows a source toggle (Marca/Formulario), duration, badge, and description. * Matches the boceto design with dashed borders and pill-style toggles. */ export const SegmentCard: React.FC = ({ scene, position, designMD, previewBrand, onSourceChange, onDurationChange, onLabelChange, onRequiredChange, onTransitionChange, onRemove, }) => { const isIntro = position === 'before'; const isBrand = scene.segmentSource === 'brand'; // Check if brand has the required video const brandVideoUrl = isIntro ? designMD.introVideoUrl : designMD.outroVideoUrl; const hasBrandVideo = !!brandVideoUrl; const brandMissing = isBrand && !hasBrandVideo; const borderColor = isBrand ? '#8b5cf6' : '#3b82f6'; const badgeBg = isBrand ? 'bg-violet-500/15' : 'bg-sky-500/15'; const badgeText = isBrand ? 'text-violet-300' : 'text-sky-300'; const badgeBorder = isBrand ? 'border-violet-500/30' : 'border-sky-500/30'; return (
{/* Header: title + duration + remove */}
{isIntro ? 'Antes' : 'Después'}
{/* Duration */}
onDurationChange(Math.max(1, Number(e.target.value)))} title="Duración en segundos" className="w-8 bg-transparent text-[9px] font-mono text-neutral-400 text-right border-none outline-none" step={0.5} min={1} max={30} /> s
{/* Remove */}
{/* Source toggle */}
{/* Badge */}
{isBrand ? ( <> Auto ) : ( <> Campo )}
{/* Description */}
{isBrand ? ( <>

{isIntro ? 'Intro de la marca' : 'Outro de la marca'}

{previewBrand ? (hasBrandVideo ? 'desde el Design MD' : '') : 'desde el Design MD'}

{brandMissing && previewBrand && (
{previewBrand.name} no tiene {isIntro ? 'intro' : 'outro'}
)} {hasBrandVideo && previewBrand && (
)} ) : ( <>

{scene.segmentFieldLabel || (isIntro ? 'Video de intro' : 'Video de cierre')}

el productor lo sube

{/* Label config */} onLabelChange(e.target.value)} placeholder="Etiqueta del campo" title="Nombre del campo en el formulario" className="mt-1.5 w-full bg-neutral-800/50 border border-neutral-700/40 rounded-md px-2 py-1 text-[8px] text-white placeholder-neutral-600 outline-none focus:border-sky-500/40" /> )}
{/* Transition selector */}
{/* Position summary */} {(scene.segmentVideoX != null || scene.segmentVideoW != null) && (
📐 {(scene.segmentVideoX ?? 50).toFixed(0)},{(scene.segmentVideoY ?? 50).toFixed(0)} {(scene.segmentVideoW ?? 100).toFixed(0)}×{(scene.segmentVideoH ?? 100).toFixed(0)} {scene.segmentVideoFit && scene.segmentVideoFit !== 'cover' && ( ({scene.segmentVideoFit}) )}
)}
); };