-
Notifications
You must be signed in to change notification settings - Fork 144
Expand file tree
/
Copy pathModelWarningBanner.tsx
More file actions
35 lines (30 loc) · 1.28 KB
/
ModelWarningBanner.tsx
File metadata and controls
35 lines (30 loc) · 1.28 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
import { useNavigate } from "react-router-dom";
import { MessageBanner } from "@/lib/components/common/MessageBanner";
import { Button } from "@/lib/components/ui";
interface ModelWarningBannerProps {
showWarning: boolean;
hasModelConfigWrite: boolean;
}
export function ModelWarningBanner({ showWarning, hasModelConfigWrite }: ModelWarningBannerProps) {
const navigate = useNavigate();
if (!showWarning) return null;
return (
<MessageBanner
variant="warning"
style={{ alignItems: "center" }}
message={
<div className="flex w-full items-center justify-between gap-3">
<span>
No model has been set up. Some features may not work as intended without a configured model.
{hasModelConfigWrite ? " Go to Agent Mesh to configure your models." : " Ask your administrator to configure models in Agent Mesh."}
</span>
{hasModelConfigWrite && (
<Button variant="outline" size="sm" className="shrink-0" onClick={() => navigate("/agents?tab=models")}>
Go to Models
</Button>
)}
</div>
}
/>
);
}