import React, { useState } from "react"; import { Download, Play } from "lucide-react"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { cn } from "@/lib/utils"; import { ResourceModal } from "./resource-modal"; import type { ResourceVideoCardProps, ResourceEmailTemplateCardProps, ResourceDocumentCardProps, } from "./types"; export function ResourceVideoCard({ video }: ResourceVideoCardProps) { const [modalOpen, setModalOpen] = useState(false); return ( <> setModalOpen(true)} className="group relative flex w-full flex-col gap-2 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring" > {/* Thumbnail */} {video.thumbnailUrl ? ( ) : ( )} {/* Play overlay on hover */} {/* Duration badge */} {video.duration && ( {video.duration} )} {/* Title */} {video.title} setModalOpen(false)} title={video.title} videoUrl={video.videoUrl} tags={video.tags} attachments={video.attachments} /> > ); } /** * @deprecated Batch-send era — the Resource Center no longer manages email * templates. Use the Email Marketing Hub template components instead * (EmailTemplateCard flow in the backoffice hub). Removed at the next major. */ export function ResourceEmailTemplateCard({ template, onClick, }: ResourceEmailTemplateCardProps) { if (template.isAddTemplate) { return ( + Add Template ); } return ( {/* Preview area */} {template.htmlContent ? ( ) : ( No preview available )} {/* Hover overlay */} Use Template {/* Meta */} {template.title} {template.type && ( {template.type === "system" ? "System" : "Company"} )} ); } export function ResourceDocumentCard({ document, onClick, }: ResourceDocumentCardProps) { return ( {/* PDF preview */} {document.pdfUrl ? ( ) : document.thumbnailUrl ? ( ) : ( {document.title} )} {/* Footer: tags + download */} {document.title} {document.tags && document.tags.length > 0 && ( {document.tags.map((tag) => ( {tag} ))} )} {document.downloadUrl && ( e.stopPropagation()} className="shrink-0" aria-label={`Download ${document.title}`} > )} ); }
{video.title}
Add Template
No preview available
{template.title}
{document.title}