2026-02-25 18:04:32 +01:00
|
|
|
'use client';
|
|
|
|
|
|
|
|
|
|
import * as React from 'react';
|
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 { usePathname } from 'next/navigation';
|
2026-02-25 18:04:32 +01:00
|
|
|
import { cn } from '@/lib/utils';
|
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 { getToolByHref } from '@/lib/tools';
|
2026-02-25 18:04:32 +01:00
|
|
|
|
|
|
|
|
interface AppPageProps {
|
|
|
|
|
title: string;
|
|
|
|
|
description?: string;
|
|
|
|
|
children: React.ReactNode;
|
|
|
|
|
className?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function AppPage({ title, description, children, className }: AppPageProps) {
|
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 pathname = usePathname();
|
|
|
|
|
const firstSegment = pathname.split('/').filter(Boolean)[0];
|
|
|
|
|
const tool = getToolByHref(`/${firstSegment ?? ''}`);
|
|
|
|
|
const Icon = tool?.icon;
|
|
|
|
|
|
2026-02-25 18:04:32 +01:00
|
|
|
return (
|
2026-02-27 12:35:02 +01:00
|
|
|
<div className={cn("min-h-screen py-8", className)}>
|
|
|
|
|
<div className="max-w-7xl mx-auto px-8 space-y-6 animate-fade-in">
|
2026-02-25 18:04:32 +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
|
|
|
<div className="flex items-center gap-3 mb-1">
|
|
|
|
|
{Icon && <Icon className="h-6 w-6 text-primary shrink-0" />}
|
|
|
|
|
<h1 className="text-2xl font-bold">{title}</h1>
|
|
|
|
|
</div>
|
2026-02-25 18:04:32 +01:00
|
|
|
{description && (
|
2026-02-27 12:35:02 +01:00
|
|
|
<p className="text-sm text-muted-foreground">
|
2026-02-25 18:04:32 +01:00
|
|
|
{description}
|
|
|
|
|
</p>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
{children}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|