import { useNavigate } from "react-router-dom"; import { Boxes, ChevronRight, type LucideIcon } from "lucide-react"; import { cn } from "@/lib/utils"; /** * Pinned service link rendered on named dashboards. A card-shaped shortcut * that navigates to a service page (or a specific tab via query param). * * The `target` is a route path like `/services/jellyfin/svc-1` or * `/services/ssh_tasks/svc-2?tab=Files`. */ export interface PinnedServiceLinkProps { label: string; target: string; icon?: LucideIcon; className?: string; } export function PinnedServiceLink({ label, target, icon: Icon = Boxes, className, }: PinnedServiceLinkProps) { const navigate = useNavigate(); return ( ); } /** * Static helper: build a target path for a pinned service link. * Returns `/services/:type/:id` or with a `?tab=` suffix when provided. */ // eslint-disable-next-line react-refresh/only-export-components export function serviceLinkTarget( serviceType: string, serviceId: string, tab?: string, ): string { const base = `/services/${serviceType}/${serviceId}`; return tab ? `${base}?tab=${tab}` : base; }