"use client"; import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, } from "@/components/ui/accordion"; import { AsideLink } from "@/components/ui/aside-link"; import { FadeIn, FadeInStagger } from "@/components/ui/fade-in"; import { Key, LucideAArrowDown, LucideIcon, MailCheck, ScanFace, Search, Users2, UserSquare2 } from "lucide-react"; import { ReactNode, Suspense, SVGProps, useState } from "react"; import { SearchDialog, type SharedProps } from 'fumadocs-ui/components/dialog/search' import { useSearchContext } from "fumadocs-ui/provider"; import { Input } from "./ui/input"; import { usePathname } from "next/navigation"; export default function ArticleLayout() { const { setOpenSearch } = useSearchContext() const pathname = usePathname() function getDefaultValue() { const defaultValue = contents.findIndex((item) => item.list.some((listItem) => listItem.href === pathname)) return defaultValue === -1 ? 0 : defaultValue } return ( ); } interface Content { title: string; href?: string; Icon: ((props?: SVGProps) => ReactNode) | LucideIcon; list: { title: string; href: string; icon: ((props?: SVGProps) => ReactNode) | LucideIcon; group?: boolean; }[]; } const contents: Content[] = [ { title: "Get Started", Icon: () => ( ), list: [ { title: "Introduction", href: "/docs/introduction", icon: () => ( ), }, { title: "Installation", href: "/docs/installation", icon: () => ( ), }, { title: "Basic Usage", href: "/docs/basic-usage", icon: () => ( ), }, ], }, { title: "Authentication", Icon: () => ( ), list: [ { title: "Email & Password", group: true, href: "/docs/email-password", icon: () => ( ) }, { title: "Sign-In & Sign-Up", href: "/docs/email-password/sign-in-and-sign-up", icon: () => ( ) }, { title: "Password Reset", href: "/docs/email-password/password-reset", icon: () => ( ) }, { title: "Configuration", href: "/docs/email-password/configuration", icon: () => ( ) }, { title: "Social Sign-On", group: true, href: "/docs/providers/social-providers", icon: () => ( ) }, { title: "Apple", href: "/docs/providers/apple", icon: () => ( ), }, { title: "Discord", href: "/docs/providers/discord", icon: () => ( ), }, { title: "Facebook", href: "/docs/providers/facebook", icon: () => ( ), }, { title: "Github", href: "/docs/providers/github", icon: () => ( ), }, { title: "Google", href: "/docs/providers/google", icon: () => ( ), }, { title: "Twitch", href: "/docs/providers/twitch", icon: () => ( ) }, { title: "X (Twitter)", href: "/docs/providers/twitter", icon: () => ( ) } ], }, { title: "Integrations", Icon: () => ( ), list: [ { group: true, title: "Frameworks", href: "/docs/integrations", icon: LucideAArrowDown }, { title: "Hono", icon: () => ( ), href: "/docs/integrations/hono", }, { title: "Next", icon: () => ( ), href: "/docs/integrations/next", }, { title: "Nuxt", icon: () => ( ), href: "/docs/integrations/nuxt", }, { title: "Svelte Kit", icon: () => ( ), href: "/docs/integrations/svelte-kit", }, { title: "Solid Start", icon: () => ( ), href: "/docs/integrations/solid-start", }, { title: "React", icon: () => ( ), href: "/docs/integrations/react", }, ] }, { title: "Plugins", Icon: () => ( ), list: [ { title: "Introduction", icon: () => ( ), href: "/docs/plugins/introduction", }, { title: "Authentication", group: true, href: "/docs/plugins/1st-party-plugins", icon: LucideAArrowDown }, { title: "Passkey", href: "/docs/plugins/passkey", icon: () => ( ), }, { title: "Two Factor", icon: ScanFace, href: "/docs/plugins/2fa", }, { title: "Username", icon: UserSquare2, href: "/docs/plugins/username", }, { title: "Authorization", group: true, href: "/docs/plugins/1st-party-plugins", icon: LucideAArrowDown }, { title: "Organization", icon: Users2, href: "/docs/plugins/organization", }, { title: "Utility", group: true, href: "/docs/plugins/1st-party-plugins", icon: LucideAArrowDown }, { title: "Bearer", icon: Key, href: "/docs/plugins/email-verifier", }, { title: "Email Checker", icon: MailCheck, href: "/docs/plugins/email-verifier", }, ], }, // { // title: "Database", // Icon: () => ( // // // // // // ), // list: [ // { // title: "Drizzle", // href: "/docs/adapters/drizzle", // icon: () => ( // // // // ), // }, // { // title: "Prisma", // href: "/docs/adapters/prisma", // icon: () => ( // // // // ), // }, // ], // }, ];