Remove page subtitles from all dashboard pages

Subtitles added noise without value. Stripped subtitle props from all 8
PageHeader calls, removed subtitle display from TopBar, and simplified
the PageTitleContext and PageHeader interfaces to title-only.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-09-01 09:31:32 -04:00
parent 9d016a08cb
commit 4e2e847828
10 changed files with 20 additions and 32 deletions

View File

@@ -2,33 +2,25 @@
import { createContext, useContext, useState, useCallback, ReactNode } from 'react';
interface PageTitleState {
interface PageTitleContextValue {
title: string;
subtitle: string;
}
interface PageTitleContextValue extends PageTitleState {
setPageTitle: (title: string, subtitle: string) => void;
setPageTitle: (title: string) => void;
}
const PageTitleContext = createContext<PageTitleContextValue>({
title: '',
subtitle: '',
setPageTitle: () => {},
});
export function PageTitleProvider({ children }: { children: ReactNode }) {
const [state, setState] = useState<PageTitleState>({ title: '', subtitle: '' });
const [title, setTitle] = useState('');
const setPageTitle = useCallback((title: string, subtitle: string) => {
setState(prev => {
if (prev.title === title && prev.subtitle === subtitle) return prev;
return { title, subtitle };
});
const setPageTitle = useCallback((t: string) => {
setTitle(prev => prev === t ? prev : t);
}, []);
return (
<PageTitleContext.Provider value={{ ...state, setPageTitle }}>
<PageTitleContext.Provider value={{ title, setPageTitle }}>
{children}
</PageTitleContext.Provider>
);