2026-03-10 08:17:45 -04:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
import * as React from "react";
|
|
|
|
|
import { toast } from "sonner";
|
2026-03-11 12:05:38 -04:00
|
|
|
import {
|
|
|
|
|
Loader2,
|
|
|
|
|
Save,
|
|
|
|
|
Wifi,
|
|
|
|
|
WifiOff,
|
|
|
|
|
Trash2,
|
|
|
|
|
Brain,
|
|
|
|
|
FolderSearch,
|
|
|
|
|
HardDrive,
|
|
|
|
|
Plug,
|
|
|
|
|
Settings,
|
|
|
|
|
} from "lucide-react";
|
2026-03-10 08:17:45 -04:00
|
|
|
|
|
|
|
|
import { Header } from "@/components/layout/header";
|
|
|
|
|
import { Button } from "@/components/ui/button";
|
|
|
|
|
import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card";
|
|
|
|
|
import { Input } from "@/components/ui/input";
|
|
|
|
|
import { Label } from "@/components/ui/label";
|
|
|
|
|
import { Badge } from "@/components/ui/badge";
|
2026-03-11 10:24:15 -04:00
|
|
|
import {
|
|
|
|
|
Select,
|
|
|
|
|
SelectContent,
|
|
|
|
|
SelectItem,
|
|
|
|
|
SelectTrigger,
|
|
|
|
|
SelectValue,
|
|
|
|
|
} from "@/components/ui/select";
|
|
|
|
|
|
|
|
|
|
const AI_PROVIDERS = [
|
2026-03-11 12:05:38 -04:00
|
|
|
{
|
|
|
|
|
value: "gateway",
|
|
|
|
|
label: "Vercel AI Gateway",
|
|
|
|
|
defaultModel: "openai/gpt-4o-mini",
|
|
|
|
|
hint: "openai/gpt-4o-mini, google/gemini-2.5-flash, anthropic/claude-sonnet-4-20250514",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
value: "ollama",
|
|
|
|
|
label: "Ollama (Local)",
|
|
|
|
|
defaultModel: "llava:7b",
|
|
|
|
|
hint: "llava:7b, moondream, llama3.2-vision",
|
|
|
|
|
},
|
2026-03-11 10:24:15 -04:00
|
|
|
] as const;
|
2026-03-10 08:17:45 -04:00
|
|
|
|
2026-03-11 12:05:38 -04:00
|
|
|
type SettingsData = {
|
2026-03-10 08:17:45 -04:00
|
|
|
ollamaUrl: string;
|
|
|
|
|
model: string;
|
|
|
|
|
watchDir: string;
|
|
|
|
|
watching: boolean;
|
2026-03-10 14:21:05 -04:00
|
|
|
sourceRetentionDays: number;
|
|
|
|
|
imageRetentionDays: number;
|
2026-03-11 10:24:15 -04:00
|
|
|
aiProvider: string;
|
|
|
|
|
aiModel: string;
|
2026-03-10 08:17:45 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default function SettingsPage() {
|
2026-03-11 12:05:38 -04:00
|
|
|
const [settings, setSettings] = React.useState<SettingsData>({
|
2026-03-10 08:17:45 -04:00
|
|
|
ollamaUrl: "",
|
|
|
|
|
model: "",
|
|
|
|
|
watchDir: "",
|
|
|
|
|
watching: false,
|
2026-03-10 14:21:05 -04:00
|
|
|
sourceRetentionDays: 30,
|
|
|
|
|
imageRetentionDays: 180,
|
2026-03-11 12:05:38 -04:00
|
|
|
aiProvider: "gateway",
|
2026-03-11 10:24:15 -04:00
|
|
|
aiModel: "",
|
2026-03-10 08:17:45 -04:00
|
|
|
});
|
|
|
|
|
const [loading, setLoading] = React.useState(true);
|
|
|
|
|
const [saving, setSaving] = React.useState(false);
|
2026-03-11 10:24:15 -04:00
|
|
|
const [aiTestStatus, setAiTestStatus] = React.useState<"idle" | "testing" | "success" | "error">("idle");
|
2026-03-10 14:21:05 -04:00
|
|
|
const [cleanupStatus, setCleanupStatus] = React.useState<{ sourcesEligible: number; imagesEligible: number } | null>(null);
|
|
|
|
|
const [cleaning, setCleaning] = React.useState(false);
|
|
|
|
|
|
|
|
|
|
const fetchCleanupStatus = React.useCallback(() => {
|
|
|
|
|
fetch("/api/cleanup")
|
|
|
|
|
.then((r) => r.json())
|
|
|
|
|
.then((data) => {
|
|
|
|
|
if (data.sourcesEligible !== undefined) setCleanupStatus(data);
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {});
|
|
|
|
|
}, []);
|
2026-03-10 08:17:45 -04:00
|
|
|
|
|
|
|
|
React.useEffect(() => {
|
|
|
|
|
fetch("/api/settings")
|
|
|
|
|
.then((r) => r.json())
|
|
|
|
|
.then((data) => {
|
|
|
|
|
setSettings(data);
|
|
|
|
|
setLoading(false);
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
setLoading(false);
|
|
|
|
|
});
|
2026-03-10 14:21:05 -04:00
|
|
|
fetchCleanupStatus();
|
|
|
|
|
}, [fetchCleanupStatus]);
|
2026-03-10 08:17:45 -04:00
|
|
|
|
|
|
|
|
const handleSave = async () => {
|
|
|
|
|
setSaving(true);
|
|
|
|
|
try {
|
|
|
|
|
const res = await fetch("/api/settings", {
|
|
|
|
|
method: "PUT",
|
|
|
|
|
headers: { "Content-Type": "application/json" },
|
|
|
|
|
body: JSON.stringify(settings),
|
|
|
|
|
});
|
|
|
|
|
if (!res.ok) throw new Error();
|
|
|
|
|
toast.success("Settings saved");
|
|
|
|
|
} catch {
|
|
|
|
|
toast.error("Failed to save settings");
|
|
|
|
|
} finally {
|
|
|
|
|
setSaving(false);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2026-03-11 10:24:15 -04:00
|
|
|
const testAiProvider = async () => {
|
|
|
|
|
setAiTestStatus("testing");
|
2026-03-10 08:17:45 -04:00
|
|
|
try {
|
2026-03-11 10:24:15 -04:00
|
|
|
const res = await fetch("/api/ai-test", {
|
|
|
|
|
method: "POST",
|
|
|
|
|
headers: { "Content-Type": "application/json" },
|
|
|
|
|
body: JSON.stringify({
|
|
|
|
|
provider: settings.aiProvider,
|
|
|
|
|
model: settings.aiModel,
|
|
|
|
|
ollamaUrl: settings.ollamaUrl,
|
|
|
|
|
}),
|
|
|
|
|
signal: AbortSignal.timeout(15000),
|
2026-03-10 08:17:45 -04:00
|
|
|
});
|
|
|
|
|
if (res.ok) {
|
2026-03-11 10:24:15 -04:00
|
|
|
setAiTestStatus("success");
|
|
|
|
|
toast.success("AI provider connected successfully");
|
2026-03-10 08:17:45 -04:00
|
|
|
} else {
|
2026-03-11 10:24:15 -04:00
|
|
|
const data = await res.json().catch(() => ({}));
|
|
|
|
|
setAiTestStatus("error");
|
|
|
|
|
toast.error(data.error || "AI provider test failed");
|
2026-03-10 08:17:45 -04:00
|
|
|
}
|
|
|
|
|
} catch {
|
2026-03-11 10:24:15 -04:00
|
|
|
setAiTestStatus("error");
|
|
|
|
|
toast.error("Cannot reach AI provider. Check your configuration and API keys.");
|
2026-03-10 08:17:45 -04:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2026-03-11 10:24:15 -04:00
|
|
|
const handleProviderChange = (value: string | null) => {
|
|
|
|
|
if (!value) return;
|
|
|
|
|
const provider = AI_PROVIDERS.find((p) => p.value === value);
|
|
|
|
|
setSettings((s) => ({
|
|
|
|
|
...s,
|
|
|
|
|
aiProvider: value,
|
|
|
|
|
aiModel: provider?.defaultModel || "",
|
|
|
|
|
}));
|
|
|
|
|
setAiTestStatus("idle");
|
|
|
|
|
};
|
|
|
|
|
|
2026-03-10 08:17:45 -04:00
|
|
|
const toggleWatch = async () => {
|
|
|
|
|
try {
|
|
|
|
|
const action = settings.watching ? "stop" : "start";
|
|
|
|
|
const res = await fetch("/api/watch", {
|
|
|
|
|
method: "POST",
|
|
|
|
|
headers: { "Content-Type": "application/json" },
|
|
|
|
|
body: JSON.stringify({ action, watchDir: settings.watchDir }),
|
|
|
|
|
});
|
|
|
|
|
if (!res.ok) throw new Error();
|
|
|
|
|
setSettings((s) => ({ ...s, watching: !s.watching }));
|
|
|
|
|
toast.success(action === "start" ? "Folder watching started" : "Folder watching stopped");
|
|
|
|
|
} catch {
|
|
|
|
|
toast.error("Failed to toggle folder watching");
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2026-03-10 14:21:05 -04:00
|
|
|
const runCleanup = async () => {
|
|
|
|
|
setCleaning(true);
|
|
|
|
|
try {
|
|
|
|
|
const res = await fetch("/api/cleanup", {
|
|
|
|
|
method: "POST",
|
|
|
|
|
headers: { "Content-Type": "application/json" },
|
|
|
|
|
body: JSON.stringify({ dryRun: false }),
|
|
|
|
|
});
|
|
|
|
|
if (!res.ok) throw new Error();
|
|
|
|
|
const data = await res.json();
|
|
|
|
|
toast.success(
|
|
|
|
|
`Cleanup complete: ${data.sourcesDeleted} source files, ${data.imagesDeleted} images, ${data.jobsPurged} jobs removed`
|
|
|
|
|
);
|
|
|
|
|
fetchCleanupStatus();
|
|
|
|
|
} catch {
|
|
|
|
|
toast.error("Cleanup failed");
|
|
|
|
|
} finally {
|
|
|
|
|
setCleaning(false);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2026-03-10 08:17:45 -04:00
|
|
|
if (loading) {
|
|
|
|
|
return (
|
|
|
|
|
<div className="flex items-center justify-center py-20">
|
|
|
|
|
<Loader2 className="size-8 animate-spin text-muted-foreground" />
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="space-y-6">
|
2026-03-11 12:05:38 -04:00
|
|
|
<Header title="Settings" description="Configure OCR and app settings" icon={Settings}>
|
|
|
|
|
<Button className="rounded-xl" onClick={handleSave} disabled={saving}>
|
2026-03-10 08:17:45 -04:00
|
|
|
{saving ? <Loader2 className="mr-2 size-4 animate-spin" /> : <Save className="mr-2 size-4" />}
|
|
|
|
|
Save Settings
|
|
|
|
|
</Button>
|
|
|
|
|
</Header>
|
|
|
|
|
|
2026-03-11 12:05:38 -04:00
|
|
|
<div className="grid gap-4 sm:gap-6 grid-cols-1 lg:grid-cols-2">
|
|
|
|
|
<Card variant="glass">
|
2026-03-10 08:17:45 -04:00
|
|
|
<CardHeader>
|
2026-03-11 12:05:38 -04:00
|
|
|
<div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
2026-03-10 08:17:45 -04:00
|
|
|
<div>
|
2026-03-11 10:24:15 -04:00
|
|
|
<CardTitle className="flex items-center gap-2 text-base">
|
2026-03-11 12:05:38 -04:00
|
|
|
<Brain className="size-4 text-primary" />
|
2026-03-11 10:24:15 -04:00
|
|
|
AI Provider
|
|
|
|
|
</CardTitle>
|
|
|
|
|
<CardDescription>Choose the AI model for OCR processing</CardDescription>
|
2026-03-10 08:17:45 -04:00
|
|
|
</div>
|
|
|
|
|
<Badge
|
|
|
|
|
variant="secondary"
|
|
|
|
|
className={
|
2026-03-11 10:24:15 -04:00
|
|
|
aiTestStatus === "success"
|
2026-03-11 12:05:38 -04:00
|
|
|
? "bg-emerald-500/10 text-emerald-700 dark:text-emerald-300"
|
2026-03-11 10:24:15 -04:00
|
|
|
: aiTestStatus === "error"
|
2026-03-11 12:05:38 -04:00
|
|
|
? "bg-red-500/10 text-red-700 dark:text-red-300"
|
2026-03-10 08:17:45 -04:00
|
|
|
: ""
|
|
|
|
|
}
|
|
|
|
|
>
|
2026-03-11 10:24:15 -04:00
|
|
|
{aiTestStatus === "success" && <Wifi className="mr-1 size-3" />}
|
|
|
|
|
{aiTestStatus === "error" && <WifiOff className="mr-1 size-3" />}
|
|
|
|
|
{aiTestStatus === "testing" && <Loader2 className="mr-1 size-3 animate-spin" />}
|
|
|
|
|
{aiTestStatus === "success"
|
|
|
|
|
? "Connected"
|
|
|
|
|
: aiTestStatus === "error"
|
|
|
|
|
? "Error"
|
|
|
|
|
: aiTestStatus === "testing"
|
|
|
|
|
? "Testing..."
|
|
|
|
|
: "Not tested"}
|
2026-03-10 08:17:45 -04:00
|
|
|
</Badge>
|
|
|
|
|
</div>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent className="space-y-4">
|
|
|
|
|
<div>
|
2026-03-11 10:24:15 -04:00
|
|
|
<Label className="mb-1.5 block text-xs font-medium text-muted-foreground">Provider</Label>
|
|
|
|
|
<Select value={settings.aiProvider} onValueChange={handleProviderChange}>
|
|
|
|
|
<SelectTrigger>
|
|
|
|
|
<SelectValue placeholder="Select a provider" />
|
|
|
|
|
</SelectTrigger>
|
|
|
|
|
<SelectContent>
|
|
|
|
|
{AI_PROVIDERS.map((p) => (
|
|
|
|
|
<SelectItem key={p.value} value={p.value}>
|
|
|
|
|
{p.label}
|
|
|
|
|
</SelectItem>
|
|
|
|
|
))}
|
|
|
|
|
</SelectContent>
|
|
|
|
|
</Select>
|
2026-03-10 08:17:45 -04:00
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<Label className="mb-1.5 block text-xs font-medium text-muted-foreground">Model</Label>
|
|
|
|
|
<Input
|
2026-03-11 10:24:15 -04:00
|
|
|
value={settings.aiModel}
|
|
|
|
|
onChange={(e) => setSettings((s) => ({ ...s, aiModel: e.target.value }))}
|
|
|
|
|
placeholder={AI_PROVIDERS.find((p) => p.value === settings.aiProvider)?.defaultModel || ""}
|
2026-03-10 08:17:45 -04:00
|
|
|
/>
|
|
|
|
|
<p className="mt-1 text-xs text-muted-foreground">
|
2026-03-11 10:24:15 -04:00
|
|
|
{AI_PROVIDERS.find((p) => p.value === settings.aiProvider)?.hint || ""}
|
2026-03-10 08:17:45 -04:00
|
|
|
</p>
|
|
|
|
|
</div>
|
2026-03-11 10:24:15 -04:00
|
|
|
|
|
|
|
|
{settings.aiProvider === "ollama" && (
|
|
|
|
|
<div>
|
|
|
|
|
<Label className="mb-1.5 block text-xs font-medium text-muted-foreground">Ollama URL</Label>
|
|
|
|
|
<Input
|
|
|
|
|
value={settings.ollamaUrl}
|
|
|
|
|
onChange={(e) => setSettings((s) => ({ ...s, ollamaUrl: e.target.value }))}
|
|
|
|
|
placeholder="http://192.168.68.108:11434"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
2026-03-11 12:05:38 -04:00
|
|
|
{settings.aiProvider === "gateway" && (
|
|
|
|
|
<div className="rounded-xl border border-border/50 bg-muted/30 p-3">
|
2026-03-11 10:24:15 -04:00
|
|
|
<p className="text-xs text-muted-foreground">
|
2026-03-11 12:05:38 -04:00
|
|
|
Uses the <code className="rounded-md bg-muted px-1.5 py-0.5 text-foreground/80">AI_GATEWAY_API_KEY</code> env
|
|
|
|
|
var. Model format: <code className="rounded-md bg-muted px-1.5 py-0.5 text-foreground/80">provider/model</code>
|
2026-03-11 10:24:15 -04:00
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
2026-03-11 12:05:38 -04:00
|
|
|
<Button variant="outline" size="sm" className="rounded-xl" onClick={testAiProvider} disabled={aiTestStatus === "testing"}>
|
2026-03-11 10:24:15 -04:00
|
|
|
{aiTestStatus === "testing" ? (
|
|
|
|
|
<Loader2 className="mr-2 size-3 animate-spin" />
|
|
|
|
|
) : (
|
|
|
|
|
<Wifi className="mr-2 size-3" />
|
|
|
|
|
)}
|
2026-03-10 08:17:45 -04:00
|
|
|
Test Connection
|
|
|
|
|
</Button>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
|
2026-03-11 12:05:38 -04:00
|
|
|
<Card variant="glass">
|
2026-03-10 08:17:45 -04:00
|
|
|
<CardHeader>
|
2026-03-11 12:05:38 -04:00
|
|
|
<CardTitle className="flex items-center gap-2 text-base">
|
|
|
|
|
<FolderSearch className="size-4 text-primary" />
|
|
|
|
|
Folder Monitoring
|
|
|
|
|
</CardTitle>
|
2026-03-10 08:17:45 -04:00
|
|
|
<CardDescription>Automatically process new PDFs dropped into a folder</CardDescription>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent className="space-y-4">
|
|
|
|
|
<div>
|
|
|
|
|
<Label className="mb-1.5 block text-xs font-medium text-muted-foreground">Watch Directory</Label>
|
|
|
|
|
<Input
|
|
|
|
|
value={settings.watchDir}
|
|
|
|
|
onChange={(e) => setSettings((s) => ({ ...s, watchDir: e.target.value }))}
|
|
|
|
|
placeholder="/data/watch"
|
|
|
|
|
/>
|
|
|
|
|
<p className="mt-1 text-xs text-muted-foreground">
|
|
|
|
|
Absolute path on the server. Mount a host folder into the container.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
2026-03-11 12:05:38 -04:00
|
|
|
<div className="flex flex-wrap items-center gap-3">
|
2026-03-10 08:17:45 -04:00
|
|
|
<Button
|
|
|
|
|
variant={settings.watching ? "destructive" : "outline"}
|
|
|
|
|
size="sm"
|
2026-03-11 12:05:38 -04:00
|
|
|
className="rounded-xl"
|
2026-03-10 08:17:45 -04:00
|
|
|
onClick={toggleWatch}
|
|
|
|
|
disabled={!settings.watchDir}
|
|
|
|
|
>
|
|
|
|
|
{settings.watching ? "Stop Watching" : "Start Watching"}
|
|
|
|
|
</Button>
|
|
|
|
|
{settings.watching && (
|
2026-03-11 12:05:38 -04:00
|
|
|
<Badge className="bg-emerald-500/10 text-emerald-700 dark:text-emerald-300">
|
2026-03-10 08:17:45 -04:00
|
|
|
Active
|
|
|
|
|
</Badge>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
|
2026-03-11 12:05:38 -04:00
|
|
|
<Card variant="glass">
|
2026-03-10 14:21:05 -04:00
|
|
|
<CardHeader>
|
2026-03-11 12:05:38 -04:00
|
|
|
<CardTitle className="flex items-center gap-2 text-base">
|
|
|
|
|
<HardDrive className="size-4 text-primary" />
|
|
|
|
|
Storage & Cleanup
|
|
|
|
|
</CardTitle>
|
2026-03-10 14:21:05 -04:00
|
|
|
<CardDescription>Auto-purge uploaded files and images to save storage</CardDescription>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent className="space-y-4">
|
|
|
|
|
<div>
|
|
|
|
|
<Label className="mb-1.5 block text-xs font-medium text-muted-foreground">
|
|
|
|
|
Source PDF Retention (days)
|
|
|
|
|
</Label>
|
|
|
|
|
<Input
|
|
|
|
|
type="number"
|
|
|
|
|
min={1}
|
|
|
|
|
value={settings.sourceRetentionDays}
|
|
|
|
|
onChange={(e) =>
|
|
|
|
|
setSettings((s) => ({
|
|
|
|
|
...s,
|
|
|
|
|
sourceRetentionDays: parseInt(e.target.value) || 30,
|
|
|
|
|
}))
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
<p className="mt-1 text-xs text-muted-foreground">
|
|
|
|
|
Original uploaded PDFs are deleted after this many days. Card data is kept.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div>
|
|
|
|
|
<Label className="mb-1.5 block text-xs font-medium text-muted-foreground">
|
|
|
|
|
Image Retention (days)
|
|
|
|
|
</Label>
|
|
|
|
|
<Input
|
|
|
|
|
type="number"
|
|
|
|
|
min={1}
|
|
|
|
|
value={settings.imageRetentionDays}
|
|
|
|
|
onChange={(e) =>
|
|
|
|
|
setSettings((s) => ({
|
|
|
|
|
...s,
|
|
|
|
|
imageRetentionDays: parseInt(e.target.value) || 180,
|
|
|
|
|
}))
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
<p className="mt-1 text-xs text-muted-foreground">
|
|
|
|
|
Scanned card images are removed after this many days. Card data is kept.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
2026-03-11 12:05:38 -04:00
|
|
|
<div className="rounded-xl border border-border/50 bg-muted/30 p-3">
|
|
|
|
|
<div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between">
|
2026-03-10 14:21:05 -04:00
|
|
|
<div className="text-sm">
|
|
|
|
|
{cleanupStatus ? (
|
|
|
|
|
<>
|
|
|
|
|
<span className="font-medium">{cleanupStatus.sourcesEligible}</span> source files
|
|
|
|
|
{" and "}
|
|
|
|
|
<span className="font-medium">{cleanupStatus.imagesEligible}</span> card images eligible
|
|
|
|
|
</>
|
|
|
|
|
) : (
|
|
|
|
|
"Checking..."
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
<Button
|
|
|
|
|
variant="destructive"
|
|
|
|
|
size="sm"
|
2026-03-11 12:05:38 -04:00
|
|
|
className="shrink-0 rounded-xl"
|
2026-03-10 14:21:05 -04:00
|
|
|
onClick={runCleanup}
|
|
|
|
|
disabled={cleaning || !cleanupStatus || (cleanupStatus.sourcesEligible === 0 && cleanupStatus.imagesEligible === 0)}
|
|
|
|
|
>
|
|
|
|
|
{cleaning ? <Loader2 className="mr-2 size-3 animate-spin" /> : <Trash2 className="mr-2 size-3" />}
|
|
|
|
|
Run Cleanup Now
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
|
2026-03-11 12:05:38 -04:00
|
|
|
<Card variant="glass">
|
2026-03-10 08:17:45 -04:00
|
|
|
<CardHeader>
|
2026-03-11 12:05:38 -04:00
|
|
|
<CardTitle className="flex items-center gap-2 text-base">
|
|
|
|
|
<Plug className="size-4 text-primary" />
|
|
|
|
|
Monday.com Integration
|
|
|
|
|
</CardTitle>
|
2026-03-10 08:17:45 -04:00
|
|
|
<CardDescription>Push scanned card data to Monday.com boards (coming soon)</CardDescription>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent>
|
2026-03-11 12:05:38 -04:00
|
|
|
<div className="rounded-2xl border-2 border-dashed border-muted-foreground/15 p-6 sm:p-8 text-center">
|
2026-03-10 08:17:45 -04:00
|
|
|
<p className="text-sm text-muted-foreground">
|
|
|
|
|
API endpoints are ready. Configure Monday.com connection in a future update.
|
|
|
|
|
</p>
|
|
|
|
|
<p className="mt-2 text-xs text-muted-foreground">
|
2026-03-11 12:05:38 -04:00
|
|
|
Use the REST API at <code className="rounded-md bg-muted px-1.5 py-0.5 text-foreground/80">/api/cards</code> to
|
2026-03-10 08:17:45 -04:00
|
|
|
integrate with n8n, Zapier, or Monday.com directly.
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|