2026-02-22 21:35:53 +01:00
|
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
import Link from 'next/link';
|
|
|
|
|
import { usePathname } from 'next/navigation';
|
refactor: externalize tool definitions and polish app shell
- Create lib/tools.tsx as single source of truth for all tool metadata
(title, shortTitle, navTitle, description, summary, icon, etc.)
- Update AppSidebar to render nav from centralized tools list with
descriptions, remove collapse footer button
- Update AppHeader with sidebar collapse toggle, tool short title,
and app logo; remove breadcrumbs
- Update AppPage to auto-resolve tool icon from pathname
- Update ToolsGrid/ToolCard to use shared tools data, remove per-card
gradients for uniform styling
- Add per-tool HTML title via metadata exports (title template in root
layout)
- Style landing page and 404 headings with primary theme color
- Add Toolbox icon to hero CTA, GitFork icon link in footer
- Remove footer from error page and "View on Dev" buttons
- Extract ColorPage client component for RSC metadata compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 17:46:54 +01:00
|
|
|
import { X } from 'lucide-react';
|
2026-02-22 21:35:53 +01:00
|
|
|
import { cn } from '@/lib/utils/cn';
|
|
|
|
|
import Logo from '@/components/Logo';
|
|
|
|
|
import { useSidebar } from './SidebarProvider';
|
2026-02-24 16:20:35 +01:00
|
|
|
import { Button } from '@/components/ui/button';
|
refactor: externalize tool definitions and polish app shell
- Create lib/tools.tsx as single source of truth for all tool metadata
(title, shortTitle, navTitle, description, summary, icon, etc.)
- Update AppSidebar to render nav from centralized tools list with
descriptions, remove collapse footer button
- Update AppHeader with sidebar collapse toggle, tool short title,
and app logo; remove breadcrumbs
- Update AppPage to auto-resolve tool icon from pathname
- Update ToolsGrid/ToolCard to use shared tools data, remove per-card
gradients for uniform styling
- Add per-tool HTML title via metadata exports (title template in root
layout)
- Style landing page and 404 headings with primary theme color
- Add Toolbox icon to hero CTA, GitFork icon link in footer
- Remove footer from error page and "View on Dev" buttons
- Extract ColorPage client component for RSC metadata compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 17:46:54 +01:00
|
|
|
import { tools } from '@/lib/tools';
|
2026-02-22 21:35:53 +01:00
|
|
|
|
|
|
|
|
export function AppSidebar() {
|
|
|
|
|
const pathname = usePathname();
|
refactor: externalize tool definitions and polish app shell
- Create lib/tools.tsx as single source of truth for all tool metadata
(title, shortTitle, navTitle, description, summary, icon, etc.)
- Update AppSidebar to render nav from centralized tools list with
descriptions, remove collapse footer button
- Update AppHeader with sidebar collapse toggle, tool short title,
and app logo; remove breadcrumbs
- Update AppPage to auto-resolve tool icon from pathname
- Update ToolsGrid/ToolCard to use shared tools data, remove per-card
gradients for uniform styling
- Add per-tool HTML title via metadata exports (title template in root
layout)
- Style landing page and 404 headings with primary theme color
- Add Toolbox icon to hero CTA, GitFork icon link in footer
- Remove footer from error page and "View on Dev" buttons
- Extract ColorPage client component for RSC metadata compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 17:46:54 +01:00
|
|
|
const { isOpen, isCollapsed, close } = useSidebar();
|
2026-02-22 21:35:53 +01:00
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
{/* Mobile Overlay Backdrop */}
|
|
|
|
|
{isOpen && (
|
refactor: externalize tool definitions and polish app shell
- Create lib/tools.tsx as single source of truth for all tool metadata
(title, shortTitle, navTitle, description, summary, icon, etc.)
- Update AppSidebar to render nav from centralized tools list with
descriptions, remove collapse footer button
- Update AppHeader with sidebar collapse toggle, tool short title,
and app logo; remove breadcrumbs
- Update AppPage to auto-resolve tool icon from pathname
- Update ToolsGrid/ToolCard to use shared tools data, remove per-card
gradients for uniform styling
- Add per-tool HTML title via metadata exports (title template in root
layout)
- Style landing page and 404 headings with primary theme color
- Add Toolbox icon to hero CTA, GitFork icon link in footer
- Remove footer from error page and "View on Dev" buttons
- Extract ColorPage client component for RSC metadata compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 17:46:54 +01:00
|
|
|
<div
|
2026-02-26 22:22:32 +01:00
|
|
|
className="fixed inset-0 bg-transparent backdrop-blur-sm z-40 lg:hidden"
|
2026-02-22 21:35:53 +01:00
|
|
|
onClick={close}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
<aside className={cn(
|
2026-02-27 12:35:02 +01:00
|
|
|
"fixed inset-y-0 left-0 z-50 flex flex-col border-r border-border bg-background/20 backdrop-blur-2xl transition-all duration-300 ease-in-out lg:relative lg:h-full",
|
2026-02-22 21:35:53 +01:00
|
|
|
isOpen ? "translate-x-0" : "-translate-x-full lg:translate-x-0",
|
refactor: externalize tool definitions and polish app shell
- Create lib/tools.tsx as single source of truth for all tool metadata
(title, shortTitle, navTitle, description, summary, icon, etc.)
- Update AppSidebar to render nav from centralized tools list with
descriptions, remove collapse footer button
- Update AppHeader with sidebar collapse toggle, tool short title,
and app logo; remove breadcrumbs
- Update AppPage to auto-resolve tool icon from pathname
- Update ToolsGrid/ToolCard to use shared tools data, remove per-card
gradients for uniform styling
- Add per-tool HTML title via metadata exports (title template in root
layout)
- Style landing page and 404 headings with primary theme color
- Add Toolbox icon to hero CTA, GitFork icon link in footer
- Remove footer from error page and "View on Dev" buttons
- Extract ColorPage client component for RSC metadata compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 17:46:54 +01:00
|
|
|
isCollapsed ? "lg:w-14" : "w-64"
|
2026-02-22 21:35:53 +01:00
|
|
|
)}>
|
|
|
|
|
{/* Sidebar Header */}
|
refactor: externalize tool definitions and polish app shell
- Create lib/tools.tsx as single source of truth for all tool metadata
(title, shortTitle, navTitle, description, summary, icon, etc.)
- Update AppSidebar to render nav from centralized tools list with
descriptions, remove collapse footer button
- Update AppHeader with sidebar collapse toggle, tool short title,
and app logo; remove breadcrumbs
- Update AppPage to auto-resolve tool icon from pathname
- Update ToolsGrid/ToolCard to use shared tools data, remove per-card
gradients for uniform styling
- Add per-tool HTML title via metadata exports (title template in root
layout)
- Style landing page and 404 headings with primary theme color
- Add Toolbox icon to hero CTA, GitFork icon link in footer
- Remove footer from error page and "View on Dev" buttons
- Extract ColorPage client component for RSC metadata compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 17:46:54 +01:00
|
|
|
<div className={cn(
|
|
|
|
|
"flex h-16 items-center shrink-0 border-b border-border",
|
|
|
|
|
isCollapsed ? "justify-center px-2" : "justify-between px-5"
|
|
|
|
|
)}>
|
|
|
|
|
<Link href="/" className={cn(
|
|
|
|
|
"flex items-center group overflow-hidden",
|
|
|
|
|
isCollapsed ? "justify-center" : "gap-3"
|
|
|
|
|
)}>
|
2026-02-22 21:35:53 +01:00
|
|
|
<div className="shrink-0">
|
refactor: externalize tool definitions and polish app shell
- Create lib/tools.tsx as single source of truth for all tool metadata
(title, shortTitle, navTitle, description, summary, icon, etc.)
- Update AppSidebar to render nav from centralized tools list with
descriptions, remove collapse footer button
- Update AppHeader with sidebar collapse toggle, tool short title,
and app logo; remove breadcrumbs
- Update AppPage to auto-resolve tool icon from pathname
- Update ToolsGrid/ToolCard to use shared tools data, remove per-card
gradients for uniform styling
- Add per-tool HTML title via metadata exports (title template in root
layout)
- Style landing page and 404 headings with primary theme color
- Add Toolbox icon to hero CTA, GitFork icon link in footer
- Remove footer from error page and "View on Dev" buttons
- Extract ColorPage client component for RSC metadata compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 17:46:54 +01:00
|
|
|
<Logo size={isCollapsed ? 20 : 28} />
|
2026-02-22 21:35:53 +01:00
|
|
|
</div>
|
|
|
|
|
{!isCollapsed && (
|
refactor: externalize tool definitions and polish app shell
- Create lib/tools.tsx as single source of truth for all tool metadata
(title, shortTitle, navTitle, description, summary, icon, etc.)
- Update AppSidebar to render nav from centralized tools list with
descriptions, remove collapse footer button
- Update AppHeader with sidebar collapse toggle, tool short title,
and app logo; remove breadcrumbs
- Update AppPage to auto-resolve tool icon from pathname
- Update ToolsGrid/ToolCard to use shared tools data, remove per-card
gradients for uniform styling
- Add per-tool HTML title via metadata exports (title template in root
layout)
- Style landing page and 404 headings with primary theme color
- Add Toolbox icon to hero CTA, GitFork icon link in footer
- Remove footer from error page and "View on Dev" buttons
- Extract ColorPage client component for RSC metadata compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 17:46:54 +01:00
|
|
|
<div className="min-w-0">
|
|
|
|
|
<span className="font-bold text-lg leading-tight block text-foreground">
|
|
|
|
|
Kit
|
|
|
|
|
</span>
|
|
|
|
|
<span className="text-[10px] leading-tight text-muted-foreground block">
|
|
|
|
|
Browser-first toolkit
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
2026-02-22 21:35:53 +01:00
|
|
|
)}
|
|
|
|
|
</Link>
|
refactor: externalize tool definitions and polish app shell
- Create lib/tools.tsx as single source of truth for all tool metadata
(title, shortTitle, navTitle, description, summary, icon, etc.)
- Update AppSidebar to render nav from centralized tools list with
descriptions, remove collapse footer button
- Update AppHeader with sidebar collapse toggle, tool short title,
and app logo; remove breadcrumbs
- Update AppPage to auto-resolve tool icon from pathname
- Update ToolsGrid/ToolCard to use shared tools data, remove per-card
gradients for uniform styling
- Add per-tool HTML title via metadata exports (title template in root
layout)
- Style landing page and 404 headings with primary theme color
- Add Toolbox icon to hero CTA, GitFork icon link in footer
- Remove footer from error page and "View on Dev" buttons
- Extract ColorPage client component for RSC metadata compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 17:46:54 +01:00
|
|
|
{!isCollapsed && (
|
|
|
|
|
<Button
|
|
|
|
|
variant="ghost"
|
|
|
|
|
size="icon"
|
|
|
|
|
className="lg:hidden text-muted-foreground"
|
|
|
|
|
onClick={close}
|
|
|
|
|
>
|
|
|
|
|
<X className="h-5 w-5" />
|
|
|
|
|
</Button>
|
|
|
|
|
)}
|
2026-02-22 21:35:53 +01:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Navigation */}
|
refactor: externalize tool definitions and polish app shell
- Create lib/tools.tsx as single source of truth for all tool metadata
(title, shortTitle, navTitle, description, summary, icon, etc.)
- Update AppSidebar to render nav from centralized tools list with
descriptions, remove collapse footer button
- Update AppHeader with sidebar collapse toggle, tool short title,
and app logo; remove breadcrumbs
- Update AppPage to auto-resolve tool icon from pathname
- Update ToolsGrid/ToolCard to use shared tools data, remove per-card
gradients for uniform styling
- Add per-tool HTML title via metadata exports (title template in root
layout)
- Style landing page and 404 headings with primary theme color
- Add Toolbox icon to hero CTA, GitFork icon link in footer
- Remove footer from error page and "View on Dev" buttons
- Extract ColorPage client component for RSC metadata compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 17:46:54 +01:00
|
|
|
<nav className={cn(
|
|
|
|
|
"flex-1 overflow-y-auto py-2 space-y-6 mt-4 overflow-hidden scrollbar",
|
|
|
|
|
isCollapsed ? "px-2" : "px-4"
|
|
|
|
|
)}>
|
|
|
|
|
<div className="space-y-0.5">
|
|
|
|
|
{tools.map((tool) => {
|
|
|
|
|
const isActive = pathname === tool.href || (tool.href !== '/' && pathname.startsWith(tool.href));
|
|
|
|
|
const Icon = tool.icon;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div key={tool.href} className="space-y-1">
|
|
|
|
|
<Link
|
|
|
|
|
href={tool.href}
|
|
|
|
|
onClick={() => { if (window.innerWidth < 1024) close(); }}
|
|
|
|
|
className={cn(
|
|
|
|
|
"flex items-center px-3 py-2 rounded-lg text-sm font-medium transition-all duration-300 relative group/item",
|
|
|
|
|
isActive
|
|
|
|
|
? "bg-primary/10 text-primary border-l-2 border-primary"
|
|
|
|
|
: "text-foreground/80 hover:bg-accent/50 hover:text-foreground",
|
|
|
|
|
isCollapsed ? "justify-center" : "justify-between"
|
|
|
|
|
)}
|
|
|
|
|
title={isCollapsed ? tool.navTitle : undefined}
|
|
|
|
|
>
|
|
|
|
|
<div className="flex items-center gap-3 min-w-0">
|
|
|
|
|
<span className={cn(
|
|
|
|
|
"transition-colors duration-300 shrink-0",
|
|
|
|
|
isActive ? "text-primary" : "text-foreground/80 group-hover/item:text-foreground"
|
|
|
|
|
)}>
|
|
|
|
|
<Icon className="h-4 w-4" />
|
|
|
|
|
</span>
|
|
|
|
|
{!isCollapsed && (
|
|
|
|
|
<div className="min-w-0">
|
|
|
|
|
<span className="whitespace-nowrap block">{tool.navTitle}</span>
|
|
|
|
|
<span className="text-[10px] text-muted-foreground leading-tight block line-clamp-2">{tool.description}</span>
|
2026-02-22 21:35:53 +01:00
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
refactor: externalize tool definitions and polish app shell
- Create lib/tools.tsx as single source of truth for all tool metadata
(title, shortTitle, navTitle, description, summary, icon, etc.)
- Update AppSidebar to render nav from centralized tools list with
descriptions, remove collapse footer button
- Update AppHeader with sidebar collapse toggle, tool short title,
and app logo; remove breadcrumbs
- Update AppPage to auto-resolve tool icon from pathname
- Update ToolsGrid/ToolCard to use shared tools data, remove per-card
gradients for uniform styling
- Add per-tool HTML title via metadata exports (title template in root
layout)
- Style landing page and 404 headings with primary theme color
- Add Toolbox icon to hero CTA, GitFork icon link in footer
- Remove footer from error page and "View on Dev" buttons
- Extract ColorPage client component for RSC metadata compatibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 17:46:54 +01:00
|
|
|
</Link>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
})}
|
|
|
|
|
</div>
|
2026-02-22 21:35:53 +01:00
|
|
|
</nav>
|
|
|
|
|
|
|
|
|
|
</aside>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
}
|