mirror of
https://github.com/fosrl/pangolin.git
synced 2026-08-19 10:42:57 +02:00
add help banner to providers and virtual api keys
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
"use client";
|
||||
|
||||
import { Sparkles } from "lucide-react";
|
||||
import { useTranslations } from "next-intl";
|
||||
import DismissableBanner from "./DismissableBanner";
|
||||
|
||||
export const AiProvidersBanner = () => {
|
||||
const t = useTranslations();
|
||||
|
||||
return (
|
||||
<DismissableBanner
|
||||
storageKey="ai-providers-banner-dismissed"
|
||||
version={1}
|
||||
title={t("aiProvidersBannerTitle")}
|
||||
titleIcon={<Sparkles className="w-5 h-5 text-primary" />}
|
||||
description={t("aiProvidersBannerDescription")}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default AiProvidersBanner;
|
||||
@@ -0,0 +1,45 @@
|
||||
"use client";
|
||||
|
||||
import { Button } from "@app/components/ui/button";
|
||||
import { useEnvContext } from "@app/hooks/useEnvContext";
|
||||
import { ArrowRight, KeyRound } from "lucide-react";
|
||||
import { useTranslations } from "next-intl";
|
||||
import Link from "next/link";
|
||||
import DismissableBanner from "./DismissableBanner";
|
||||
|
||||
type VirtualApiKeysBannerProps = {
|
||||
orgId: string;
|
||||
};
|
||||
|
||||
export const VirtualApiKeysBanner = ({ orgId }: VirtualApiKeysBannerProps) => {
|
||||
const t = useTranslations();
|
||||
const { env } = useEnvContext();
|
||||
|
||||
const dashboardUrl = env.app.dashboardUrl?.replace(/\/$/, "") ?? "";
|
||||
const keysUrl = dashboardUrl
|
||||
? `${dashboardUrl}/${orgId}/keys`
|
||||
: `/${orgId}/keys`;
|
||||
|
||||
return (
|
||||
<DismissableBanner
|
||||
storageKey="virtual-api-keys-banner-dismissed"
|
||||
version={1}
|
||||
title={t("virtualApiKeysBannerTitle")}
|
||||
titleIcon={<KeyRound className="w-5 h-5 text-primary" />}
|
||||
description={t("virtualApiKeysBannerDescription", { keysUrl })}
|
||||
>
|
||||
<Link href={`/${orgId}/keys`}>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="gap-2 hover:bg-primary/10 hover:border-primary/50 transition-colors"
|
||||
>
|
||||
{t("virtualApiKeysBannerButtonText")}
|
||||
<ArrowRight className="w-4 h-4" />
|
||||
</Button>
|
||||
</Link>
|
||||
</DismissableBanner>
|
||||
);
|
||||
};
|
||||
|
||||
export default VirtualApiKeysBanner;
|
||||
Reference in New Issue
Block a user