'use client' import { useTranslations } from 'next-intl' import { Button } from '@/components/ui/button' import { X, Edit, Play, Calendar, Tag } from 'lucide-react' interface Prompt { id: string name: string description: string | null content: string tags: string[] createdAt: string updatedAt: string lastUsed?: string | null currentVersion?: number usage?: number } interface PromptDetailModalProps { prompt: Prompt | null isOpen: boolean onClose: () => void onEdit: (id: string) => void onDebug: (id: string) => void } export function PromptDetailModal({ prompt, isOpen, onClose, onEdit, onDebug }: PromptDetailModalProps) { const t = useTranslations('studio') const tCommon = useTranslations('common') const formatDate = (dateString: string) => { return new Intl.DateTimeFormat('default', { year: 'numeric', month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit' }).format(new Date(dateString)) } if (!isOpen || !prompt) return null return (
{/* Backdrop */}
{/* Modal */}
{/* Header */}

{prompt.name}

{prompt.description && (

{prompt.description}

)}
{/* Content */}
{/* Tags */} {prompt.tags && prompt.tags.length > 0 && (
{t('tags')}
{prompt.tags.map((tag: string | { name: string }) => { const tagName = typeof tag === 'string' ? tag : tag?.name || ''; return ( {tagName} ); })}
)} {/* Prompt Content */}

{t('promptContent')}

                {prompt.content}
              
{/* Metadata */}
{t('createdAt')}: {formatDate(prompt.createdAt)}
{t('updatedAt')}: {formatDate(prompt.updatedAt)}
{prompt.lastUsed && (
{t('lastUsed')}: {formatDate(prompt.lastUsed)}
)} {prompt.currentVersion && (
{t('version')}: v{prompt.currentVersion}
)}
{/* Footer Actions */}
) }