"use client";
import { usePathname } from "next/navigation";
import {
BreadcrumbItem,
BreadcrumbPage,
BreadcrumbSeparator,
} from "./ui/breadcrumb";
import { allDocs } from "contentlayer/generated";
export default function TextFromPathname() {
const pathname = usePathname();
return (
<>
{pathname == "/" && (
<>
Home
>
)}
{pathname?.startsWith("/server") && (
<>
Server
{pathname.split("/server/")[1].split("/")[0]}
{pathname.endsWith("/historical-data") && (
<>
Historical Data
>
)}
{pathname.endsWith("/customize") && (
<>
Customize
>
)}
>
)}
{pathname == "/account/favorites" && (
<>
Favorites
>
)}
{pathname == "/account/claim-account" && (
<>
Claim Minecraft Account
>
)}
{pathname == "/account/settings" && (
<>
Settings
>
)}
{pathname == "/account/settings/options" && (
<>
Settings
Preferences
>
)}
{pathname == "/legal/external-content-agreement" && (
<>
Legal
ECA Agreement
>
)}
{pathname == "/sort/favorites" && (
<>
Sort
Favorites
>
)}
{pathname?.startsWith("/docs/") && (
<>
Docs
{
allDocs.find(
(c) =>
c._raw.flattenedPath ===
pathname
?.split("/")
.splice(2, pathname?.split("/").length)
.join("/")
)?.title
}
>
)}
>
);
}