2026-02-22 21:35:53 +01:00
|
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
import Link from 'next/link';
|
2026-03-01 08:58:33 +01:00
|
|
|
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 { Menu, X, PanelLeftClose, PanelLeftOpen } from 'lucide-react';
|
2026-03-01 08:58:33 +01:00
|
|
|
import { cn } from '@/lib/utils/cn';
|
2026-02-22 21:35:53 +01:00
|
|
|
import { useSidebar } from './SidebarProvider';
|
2026-03-01 08:58:33 +01:00
|
|
|
import { getToolByHref } from '@/lib/tools';
|
2026-02-23 13:33:17 +01:00
|
|
|
import Logo from '@/components/Logo';
|
2026-02-22 21:35:53 +01:00
|
|
|
|
2026-03-01 08:58:33 +01:00
|
|
|
const iconBtn =
|
|
|
|
|
'w-8 h-8 flex items-center justify-center rounded-lg text-muted-foreground/50 hover:text-foreground hover:bg-white/5 transition-all';
|
|
|
|
|
|
2026-02-22 21:35:53 +01:00
|
|
|
export function AppHeader() {
|
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 { toggle, isOpen, isCollapsed, toggleCollapse } = useSidebar();
|
2026-03-01 08:58:33 +01:00
|
|
|
const pathname = usePathname();
|
|
|
|
|
const tool = getToolByHref(pathname);
|
2026-02-22 21:35:53 +01:00
|
|
|
|
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
|
|
|
return (
|
2026-03-01 08:58:33 +01:00
|
|
|
<header className="h-14 border-b border-border/20 bg-background/8 backdrop-blur-xl sticky top-0 z-40 flex items-center justify-between px-4 gap-3">
|
|
|
|
|
<div className="flex items-center gap-1.5 min-w-0">
|
|
|
|
|
{/* Desktop: sidebar collapse toggle */}
|
|
|
|
|
<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
|
|
|
onClick={toggleCollapse}
|
2026-03-01 08:58:33 +01:00
|
|
|
title={isCollapsed ? 'Expand sidebar' : 'Collapse sidebar'}
|
|
|
|
|
className={cn(iconBtn, 'hidden lg:flex shrink-0')}
|
2026-02-24 16:58:17 +01:00
|
|
|
>
|
2026-03-01 08:58:33 +01:00
|
|
|
{isCollapsed
|
|
|
|
|
? <PanelLeftOpen className="w-4 h-4" />
|
|
|
|
|
: <PanelLeftClose className="w-4 h-4" />
|
|
|
|
|
}
|
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
{/* Mobile: logo home link */}
|
|
|
|
|
<Link href="/" className="lg:hidden shrink-0">
|
|
|
|
|
<Logo size={20} />
|
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>
|
2026-03-01 08:58:33 +01:00
|
|
|
|
|
|
|
|
{/* Current tool breadcrumb */}
|
|
|
|
|
{tool && (
|
|
|
|
|
<div className="flex items-center gap-1.5 min-w-0 ml-1">
|
|
|
|
|
<span className="text-border/50 text-xs select-none">/</span>
|
|
|
|
|
<span className="text-sm text-foreground/60 truncate font-mono">
|
|
|
|
|
{tool.navTitle}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
2026-02-22 21:35:53 +01:00
|
|
|
</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
|
|
|
|
2026-03-01 08:58:33 +01:00
|
|
|
{/* Mobile: open/close sidebar */}
|
|
|
|
|
<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
|
|
|
onClick={toggle}
|
2026-03-01 08:58:33 +01:00
|
|
|
title={isOpen ? 'Close menu' : 'Open menu'}
|
|
|
|
|
className={cn(iconBtn, 'lg:hidden 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
|
|
|
>
|
2026-03-01 08:58:33 +01:00
|
|
|
{isOpen ? <X className="w-4 h-4" /> : <Menu className="w-4 h-4" />}
|
|
|
|
|
</button>
|
2026-02-22 21:35:53 +01:00
|
|
|
</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
|
|
|
}
|