V0 : initial import
This commit is contained in:
25
PS_Report/src/components/PrintHeader.tsx
Normal file
25
PS_Report/src/components/PrintHeader.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import { useI18n } from '../i18n/context';
|
||||
|
||||
const BASE = import.meta.env.BASE_URL || '/';
|
||||
const logoImg = `${BASE}logo.png`;
|
||||
|
||||
interface PrintHeaderProps {
|
||||
subtitle?: string;
|
||||
}
|
||||
|
||||
function PrintHeader({ subtitle }: PrintHeaderProps) {
|
||||
const { t } = useI18n();
|
||||
const now = new Date();
|
||||
const dateStr = now.toLocaleDateString('fr-FR', { day: '2-digit', month: '2-digit', year: 'numeric', hour: '2-digit', minute: '2-digit' });
|
||||
|
||||
return (
|
||||
<div className="print-header">
|
||||
<img src={logoImg} alt="Logo" />
|
||||
<span className="print-title">PROSERVE Report</span>
|
||||
{subtitle && <span style={{ color: '#333', fontSize: '0.9rem' }}>— {subtitle}</span>}
|
||||
<span className="print-subtitle">{t('print.generatedOn')} {dateStr}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default PrintHeader;
|
||||
Reference in New Issue
Block a user