Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-19 15:49:05 +00:00
co-authored by renee-png
parent 05008eff93
commit 8be6ecf197
+33
View File
@@ -1105,6 +1105,39 @@ function ImportPage() {
);
})}
</div>
<Dialog open={!!pasteFor} onOpenChange={(o) => !o && setPasteFor(null)}>
<DialogContent className="max-w-2xl">
<DialogHeader>
<DialogTitle>Paste CSV — {pasteFor?.label}</DialogTitle>
<DialogDescription>
Paste CSV (or tab-separated) data including the header row. Same column rules as file upload apply.
</DialogDescription>
</DialogHeader>
<Textarea
value={pasteText}
onChange={(e) => setPasteText(e.target.value)}
placeholder={"name,email,phone\nJane Doe,jane@example.com,555-1234"}
className="min-h-[260px] font-mono text-xs"
autoFocus
/>
<DialogFooter>
<Button variant="outline" onClick={() => setPasteFor(null)}>Cancel</Button>
<Button
disabled={!pasteText.trim()}
onClick={() => {
const cfg = pasteFor;
const text = pasteText;
setPasteFor(null);
setPasteText("");
if (cfg && text.trim()) handleFile(cfg, text);
}}
>
Import
</Button>
</DialogFooter>
</DialogContent>
</Dialog>
</div>
);
}