import { useState } from 'react'; import { useT } from '../i18n'; interface Props { onSave: (name: string, content: string) => void; onClose: () => void; } export function PasteTextDialog({ onSave, onClose }: Props) { const t = useT(); const [name, setName] = useState(''); const [content, setContent] = useState(''); function commit() { const trimmed = content.trim(); if (!trimmed) return; const finalName = name.trim() || `paste-${Date.now()}.txt`; onSave(ensureExtension(finalName, '.txt'), content); } return (
e.stopPropagation()}>

{t('pasteDialog.title')}

{t('pasteDialog.hint')}