import cn from "clsx"; import { useState } from "react"; import { useRouter } from "next/router"; import { Icons } from "@instill-ai/design-system"; import * as Collapsible from "@radix-ui/react-collapsible"; import { SidebarLink } from "./SidebarLink"; export type PipelineCollapsibleProps = { className?: string; }; export const PipelineCollapsible = (props: PipelineCollapsibleProps) => { const { className } = props; const [isOpen, setIsOpen] = useState(true); const router = useRouter(); return (
} name="Pipelines" hightlighted={router.pathname.split("/")[1] === "pipelines"} className="px-3" /> {isOpen ? ( ) : ( )}
} name="Operator" hightlighted={router.pathname.split("/")[1] === "operators"} className="pl-12 pr-3" /> } name="AI" hightlighted={router.pathname.split("/")[1] === "ais"} className="pl-12 pr-3" /> } name="Blockchain" hightlighted={router.pathname.split("/")[1] === "blockchains"} className="pl-12 pr-3" /> } name="Data" hightlighted={router.pathname.split("/")[1] === "data"} className="pl-12 pr-3" />
); };