header rekated fixes

This commit is contained in:
IGNY8 VPS (Salman)
2025-12-27 05:33:05 +00:00
parent fd6e7eb2dd
commit 726d945bda
15 changed files with 414 additions and 232 deletions

View File

@@ -1,15 +1,15 @@
/**
* Page Context - Shares current page info with header
* Allows pages to set title, breadcrumb, badge for display in AppHeader
* Allows pages to set title, parent module, badge for display in AppHeader
*/
import React, { createContext, useContext, useState, ReactNode } from 'react';
interface PageInfo {
title: string;
breadcrumb?: string;
parent?: string; // Parent module name (e.g., "Planner", "Writer")
badge?: {
icon: ReactNode;
color: 'blue' | 'green' | 'purple' | 'orange' | 'red' | 'indigo';
color: 'blue' | 'green' | 'purple' | 'orange' | 'red' | 'indigo' | 'yellow' | 'pink' | 'emerald' | 'cyan' | 'amber' | 'teal';
};
}
@@ -44,5 +44,5 @@ export function usePage(info: PageInfo) {
React.useEffect(() => {
setPageInfo(info);
return () => setPageInfo(null);
}, [info.title, info.breadcrumb]);
}, [info.title, info.parent]);
}