import { ExternalLink, Pencil, X } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { __, sprintf } from '../lib/i18n'; interface DrawerHeaderBarProps { title: string; subtitle?: string; permalink?: string; path?: string; postId?: number; editUrl?: string; thumbnail?: string; thumbnailAlt?: string; isDirty: boolean; isSaving: boolean; saveSuccess: boolean; onSave: () => void; onClose: () => void; } export function DrawerHeaderBar({ title, subtitle, permalink, path, postId, editUrl, thumbnail, thumbnailAlt, isDirty, isSaving, saveSuccess, onSave, onClose, }: DrawerHeaderBarProps) { const linkTarget = path || subtitle; return (
{thumbnail && ( {thumbnailAlt { (e.target as HTMLImageElement).style.display = 'none'; }} /> )}

{title}

{postId != null && ( {sprintf(__('Post ID: %d', 'llmagnet-llm-txt-generator'), postId)} )} {postId != null && linkTarget && } {permalink && linkTarget ? ( {linkTarget} ) : ( subtitle && {subtitle} )}
{editUrl && ( )} {permalink && ( )}
); }