ind
This commit is contained in:
@@ -18,6 +18,7 @@ interface PageHeaderProps {
|
|||||||
icon: ReactNode;
|
icon: ReactNode;
|
||||||
color: 'blue' | 'green' | 'purple' | 'orange' | 'red' | 'indigo';
|
color: 'blue' | 'green' | 'purple' | 'orange' | 'red' | 'indigo';
|
||||||
};
|
};
|
||||||
|
hideSiteSector?: boolean; // Hide site/sector selector and info for global pages
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function PageHeader({
|
export default function PageHeader({
|
||||||
@@ -27,6 +28,7 @@ export default function PageHeader({
|
|||||||
onRefresh,
|
onRefresh,
|
||||||
className = "",
|
className = "",
|
||||||
badge,
|
badge,
|
||||||
|
hideSiteSector = false,
|
||||||
}: PageHeaderProps) {
|
}: PageHeaderProps) {
|
||||||
const { activeSite } = useSiteStore();
|
const { activeSite } = useSiteStore();
|
||||||
const { activeSector } = useSectorStore();
|
const { activeSector } = useSectorStore();
|
||||||
@@ -53,42 +55,51 @@ export default function PageHeader({
|
|||||||
)}
|
)}
|
||||||
<h2 className="text-2xl font-bold text-gray-800 dark:text-white/90">{title}</h2>
|
<h2 className="text-2xl font-bold text-gray-800 dark:text-white/90">{title}</h2>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-3 mt-1">
|
{!hideSiteSector && (
|
||||||
{lastUpdated && (
|
<div className="flex items-center gap-3 mt-1">
|
||||||
<>
|
{lastUpdated && (
|
||||||
<p className="text-sm text-gray-500 dark:text-gray-400">
|
<>
|
||||||
Last updated: {lastUpdated.toLocaleTimeString()}
|
<p className="text-sm text-gray-500 dark:text-gray-400">
|
||||||
</p>
|
Last updated: {lastUpdated.toLocaleTimeString()}
|
||||||
</>
|
</p>
|
||||||
)}
|
</>
|
||||||
{activeSite && (
|
)}
|
||||||
<>
|
{activeSite && (
|
||||||
{lastUpdated && <span className="text-sm text-gray-400 dark:text-gray-600">•</span>}
|
<>
|
||||||
<p className="text-sm font-medium text-gray-700 dark:text-gray-300">
|
{lastUpdated && <span className="text-sm text-gray-400 dark:text-gray-600">•</span>}
|
||||||
Site: <span className="text-brand-600 dark:text-brand-400">{activeSite.name}</span>
|
<p className="text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||||
</p>
|
Site: <span className="text-brand-600 dark:text-brand-400">{activeSite.name}</span>
|
||||||
</>
|
</p>
|
||||||
)}
|
</>
|
||||||
{activeSector && (
|
)}
|
||||||
<>
|
{activeSector && (
|
||||||
<span className="text-sm text-gray-400 dark:text-gray-600">•</span>
|
<>
|
||||||
<p className="text-sm font-medium text-gray-700 dark:text-gray-300">
|
<span className="text-sm text-gray-400 dark:text-gray-600">•</span>
|
||||||
Sector: <span className="text-brand-600 dark:text-brand-400">{activeSector.name}</span>
|
<p className="text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||||
</p>
|
Sector: <span className="text-brand-600 dark:text-brand-400">{activeSector.name}</span>
|
||||||
</>
|
</p>
|
||||||
)}
|
</>
|
||||||
{!activeSector && activeSite && (
|
)}
|
||||||
<>
|
{!activeSector && activeSite && (
|
||||||
<span className="text-sm text-gray-400 dark:text-gray-600">•</span>
|
<>
|
||||||
<p className="text-sm font-medium text-gray-700 dark:text-gray-300">
|
<span className="text-sm text-gray-400 dark:text-gray-600">•</span>
|
||||||
Sector: <span className="text-brand-600 dark:text-brand-400">All Sectors</span>
|
<p className="text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||||
</p>
|
Sector: <span className="text-brand-600 dark:text-brand-400">All Sectors</span>
|
||||||
</>
|
</p>
|
||||||
)}
|
</>
|
||||||
</div>
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{hideSiteSector && lastUpdated && (
|
||||||
|
<div className="flex items-center gap-3 mt-1">
|
||||||
|
<p className="text-sm text-gray-500 dark:text-gray-400">
|
||||||
|
Last updated: {lastUpdated.toLocaleTimeString()}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-center gap-3">
|
||||||
<SiteAndSectorSelector />
|
{!hideSiteSector && <SiteAndSectorSelector />}
|
||||||
{showRefresh && onRefresh && (
|
{showRefresh && onRefresh && (
|
||||||
<button
|
<button
|
||||||
onClick={onRefresh}
|
onClick={onRefresh}
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ export default function Industries() {
|
|||||||
<PageHeader
|
<PageHeader
|
||||||
title="Industries"
|
title="Industries"
|
||||||
badge={{ icon: <PieChartIcon />, color: 'blue' }}
|
badge={{ icon: <PieChartIcon />, color: 'blue' }}
|
||||||
|
hideSiteSector={true}
|
||||||
/>
|
/>
|
||||||
<div className="p-6">
|
<div className="p-6">
|
||||||
<div className="mb-6">
|
<div className="mb-6">
|
||||||
|
|||||||
Reference in New Issue
Block a user