"use client"; import { useParams, notFound } from "next/navigation"; import Link from "next/link"; import Image from "next/image"; import { useState } from "react"; import { Card, Badge } from "@/shared/components"; import { MEDIA_PROVIDER_KINDS, AI_PROVIDERS } from "@/shared/constants/providers"; import { useCopyToClipboard } from "@/shared/hooks/useCopyToClipboard"; import ConnectionsCard from "@/app/(dashboard)/dashboard/providers/components/ConnectionsCard"; import ModelsCard from "@/app/(dashboard)/dashboard/providers/components/ModelsCard"; export default function MediaProviderDetailPage() { const { kind, id } = useParams(); const { copied, copy } = useCopyToClipboard(); const [headerImgError, setHeaderImgError] = useState(false); const kindConfig = MEDIA_PROVIDER_KINDS.find((k) => k.id === kind); if (!kindConfig) return notFound(); const provider = AI_PROVIDERS[id]; if (!provider) return notFound(); const kinds = provider.serviceKinds ?? ["llm"]; if (!kinds.includes(kind)) return notFound(); const endpointText = `${kindConfig.endpoint.method} ${kindConfig.endpoint.path}`; return (
{kindConfig.label} Endpoint
{kindConfig.endpoint.path}