Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-18 03:30:17 +00:00
co-authored by renee-png
parent b4266fbdd4
commit 8b7595219e
+15 -3
View File
@@ -766,7 +766,19 @@ function ImportPage() {
</CardTitle>
<p className="text-xs text-muted-foreground mt-1">{cfg.description}</p>
</div>
<div className="shrink-0">
<div className="shrink-0 flex items-center gap-2">
{cfg.key === "locations" && (
<Select value={defaultClientId} onValueChange={setDefaultClientId}>
<SelectTrigger className="h-8 w-[220px] text-xs">
<SelectValue placeholder="Assign all rows to client…" />
</SelectTrigger>
<SelectContent>
{clientList.map((c) => (
<SelectItem key={c.id} value={c.id}>{c.name}</SelectItem>
))}
</SelectContent>
</Select>
)}
<input
type="file"
accept=".csv,text/csv"
@@ -777,9 +789,9 @@ function ImportPage() {
if (f) handleFile(cfg, f);
e.target.value = "";
}}
disabled={running}
disabled={running || (cfg.key === "locations" && !defaultClientId)}
/>
<Button asChild size="sm" variant="outline" disabled={running}>
<Button asChild size="sm" variant="outline" disabled={running || (cfg.key === "locations" && !defaultClientId)}>
<label htmlFor={`file-${cfg.key}`} className="cursor-pointer">
{running ? <Loader2 className="h-3.5 w-3.5 mr-1.5 animate-spin" /> : <Upload className="h-3.5 w-3.5 mr-1.5" />}
{running ? "Importing…" : "Upload CSV"}