"use client"; import { SettingsContainer, SettingsSection, SettingsSectionBody, SettingsSectionForm, SettingsSectionHeader, SettingsSectionTitle } from "@app/components/Settings"; import { useTranslations } from "next-intl"; import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "@app/components/ui/form"; import { useForm } from "react-hook-form"; import { Input } from "./ui/input"; import Editor from "@monaco-editor/react"; import { cn } from "@app/lib/cn"; import type { GetBlueprintResponse } from "@server/routers/blueprints"; import { Alert, AlertDescription } from "./ui/alert"; import { InfoSection, InfoSectionContent, InfoSections, InfoSectionTitle } from "./InfoSection"; import { Badge } from "./ui/badge"; import { Globe, Terminal, Webhook } from "lucide-react"; export type CreateBlueprintFormProps = { blueprint: GetBlueprintResponse; }; export default function BlueprintDetailsForm({ blueprint }: CreateBlueprintFormProps) { const t = useTranslations(); const form = useForm({ disabled: true, defaultValues: { name: blueprint.name, contents: blueprint.contents } }); return (
{t("name")} {blueprint.name} {t("status")} {blueprint.succeeded ? ( {t("success")} ) : ( {t("failed", { fallback: "Failed" })} )} {t("source")} {blueprint.source === "API" && ( API )} {blueprint.source === "NEWT" && ( Newt CLI )} {blueprint.source === "UI" && ( Dashboard )}{" "} {blueprint.source === "CLI" && ( CLI )}{" "} {t("appliedAt")} {blueprint.message && ( {t("message")}

{blueprint.message}

)}
( {t("parsedContents")}
)} />
); }