6e67c698ce
All page header subtitles now use variant="body2" color="text.secondary" (0.875rem gray). Fixed caption→body2 in DataQuality and MarketIntelligence, and aligned DashboardHeader title/subtitle to the global standard. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
36 lines
983 B
TypeScript
36 lines
983 B
TypeScript
import { Box, Chip, Typography } from '@mui/material'
|
|
|
|
interface DashboardHeaderProps {
|
|
orgName?: string
|
|
lastUpdated?: string
|
|
}
|
|
|
|
function formatLastUpdated(iso: string): string {
|
|
try {
|
|
return new Intl.DateTimeFormat('de-CH', {
|
|
dateStyle: 'short',
|
|
timeStyle: 'short',
|
|
}).format(new Date(iso))
|
|
} catch {
|
|
return iso
|
|
}
|
|
}
|
|
|
|
export function DashboardHeader({ orgName = 'Demo Organisation', lastUpdated }: DashboardHeaderProps) {
|
|
return (
|
|
<Box>
|
|
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1, mb: 0.5 }}>
|
|
<Typography sx={{ fontWeight: 700, fontSize: '1.125rem', lineHeight: 1.3, color: '#0f172a' }}>
|
|
{orgName}
|
|
</Typography>
|
|
<Chip label="Demo" size="small" color="info" variant="outlined" />
|
|
</Box>
|
|
{lastUpdated && (
|
|
<Typography variant="body2" color="text.secondary">
|
|
Zuletzt aktualisiert: {formatLastUpdated(lastUpdated)}
|
|
</Typography>
|
|
)}
|
|
</Box>
|
|
)
|
|
}
|