'use client'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { ReactNode, Suspense } from 'react'; import { TOOLS } from '../../constants/tools'; import { theme } from '../../stitches.config'; import { Loader } from './components/Loader'; interface ToolsLayoutProps { children: ReactNode; } export default function ToolsLayout({ children }: ToolsLayoutProps) { const pathname = usePathname(); const pathSplit = pathname.split('/'); const toolId = pathSplit.at(2); const tool = TOOLS.find((tool) => tool.id === toolId); return ( <> {tool && {tool.title}} {pathSplit.length === 3 && (
{tool?.title} {tool?.description}
)} }>{children} ); }