Repository navigation
Expand file tree
/
Copy pathpatch2.js
More file actions
44 lines (39 loc) · 1.81 KB
/
Copy pathpatch2.js
File metadata and controls
44 lines (39 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
const fs = require('fs');
let enJson = fs.readFileSync('messages/en.json', 'utf8');
enJson = enJson.replace(
'"messagesHub": {',
'"agentDirectory": {\n "emptyStateTitle": "No agents found",\n "emptyStateDescription": "No agents are configured in this deploy. Start by creating the first agent.",\n "errorTitle": "Could not load agents",\n "errorDescription": "There was a problem reading the directory. This might be a temporary dependency failure or a network issue.",\n "createAction": "Create an agent"\n },\n "messagesHub": {'
);
fs.writeFileSync('messages/en.json', enJson);
let emptyState = `import { useTranslations } from "next-intl";
import { UserSquare2, AlertTriangle } from "lucide-react";
import { Link } from "@/i18n/navigation";
import Button from "@/components/ui/Button";
export function AgentDirectoryEmptyState({ error = false }: { error?: boolean }) {
const t = useTranslations("agentDirectory");
return (
<div className="border border-pv-ink/[0.1] bg-pv-surface/40 px-4 py-16 text-center">
{error ? (
<AlertTriangle className="mx-auto h-8 w-8 text-pv-danger/80 mb-4" />
) : (
<UserSquare2 className="mx-auto h-8 w-8 text-pv-emerald/80 mb-4" />
)}
<h3 className="font-display text-lg font-bold text-pv-text">
{error ? t("errorTitle") : t("emptyStateTitle")}
</h3>
<p className="mt-2 text-sm text-pv-muted">
{error ? t("errorDescription") : t("emptyStateDescription")}
</p>
{!error && (
<div className="mt-6">
<Link href="/agents/new">
<Button variant="primary" className="px-6 py-2 text-sm">
{t("createAction")}
</Button>
</Link>
</div>
)}
</div>
);
}`;
fs.writeFileSync('components/agents/AgentDirectoryEmptyState.tsx', emptyState);