Compare commits
3 Commits
69272f71a3
...
claude
| Author | SHA1 | Date | |
|---|---|---|---|
| bcf0e3f3d1 | |||
| 3977c3652f | |||
| f4f191518c |
@@ -2,19 +2,19 @@ import React, { useState } from 'react';
|
|||||||
|
|
||||||
const s = {
|
const s = {
|
||||||
wrapper: { marginTop: '24px' },
|
wrapper: { marginTop: '24px' },
|
||||||
title: { color: '#2c3e50', fontSize: '16px', fontWeight: 700, marginBottom: '10px' },
|
title: { color: '#b5b5c0', fontSize: '16px', fontWeight: 700, marginBottom: '10px' },
|
||||||
table: { width: '100%', borderCollapse: 'collapse', fontSize: '13px' },
|
table: { width: '100%', borderCollapse: 'collapse', fontSize: '13px', background: '#111217', borderRadius: '6px', overflow: 'hidden', border: '1px solid #222' },
|
||||||
th: { background: '#2c3e50', color: 'white', padding: '8px 10px', textAlign: 'left' },
|
th: { background: '#000000', color: '#f8f9fa', padding: '8px 10px', textAlign: 'left', fontSize: '12px', fontWeight: 600, textTransform: 'uppercase', letterSpacing: '0.5px' },
|
||||||
td: { padding: '8px 10px', borderBottom: '1px solid #dee2e6' },
|
td: { padding: '8px 10px', borderBottom: '1px solid #1c1d29', color: '#f8f9fa', verticalAlign: 'middle' },
|
||||||
trEven: { background: '#f8f9fa' },
|
trEven: { background: '#111217' },
|
||||||
trOdd: { background: 'white' },
|
trOdd: { background: '#151622' },
|
||||||
pts: { fontWeight: 700, color: '#667eea' },
|
pts: { fontWeight: 700, color: '#667eea' },
|
||||||
toggle: { background: 'none', border: 'none', color: '#667eea', cursor: 'pointer', fontSize: '13px', padding: 0, textDecoration: 'underline' },
|
toggle: { background: 'none', border: 'none', color: '#667eea', cursor: 'pointer', fontSize: '13px', padding: 0, textDecoration: 'underline' },
|
||||||
empty: { color: '#888', fontStyle: 'italic', fontSize: '13px', marginTop: '8px' },
|
empty: { color: '#77798a', fontStyle: 'italic', fontSize: '13px', marginTop: '8px' },
|
||||||
};
|
};
|
||||||
|
|
||||||
function formatDate(d) {
|
function formatDate(d) {
|
||||||
if (!d) return '—';
|
if (!d) return '–';
|
||||||
const dt = new Date(d + 'T12:00:00');
|
const dt = new Date(d + 'T12:00:00');
|
||||||
return dt.toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric', timeZone: 'America/Chicago' });
|
return dt.toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric', timeZone: 'America/Chicago' });
|
||||||
}
|
}
|
||||||
@@ -44,9 +44,9 @@ export default function ViolationHistory({ history, loading }) {
|
|||||||
<tr key={v.id} style={i % 2 === 0 ? s.trEven : s.trOdd}>
|
<tr key={v.id} style={i % 2 === 0 ? s.trEven : s.trOdd}>
|
||||||
<td style={s.td}>{formatDate(v.incident_date)}</td>
|
<td style={s.td}>{formatDate(v.incident_date)}</td>
|
||||||
<td style={s.td}>{v.violation_name}</td>
|
<td style={s.td}>{v.violation_name}</td>
|
||||||
<td style={s.td}>{v.category}</td>
|
<td style={{ ...s.td, color: '#c0c2d6' }}>{v.category}</td>
|
||||||
<td style={{ ...s.td, ...s.pts }}>{v.points}</td>
|
<td style={{ ...s.td, ...s.pts }}>{v.points}</td>
|
||||||
<td style={s.td}>{v.details || '—'}</td>
|
<td style={{ ...s.td, color: '#c0c2d6' }}>{v.details || '–'}</td>
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -30,18 +30,12 @@ async function generatePdf(violation, score) {
|
|||||||
format: 'Letter',
|
format: 'Letter',
|
||||||
printBackground: true,
|
printBackground: true,
|
||||||
margin: {
|
margin: {
|
||||||
top: '0.6in',
|
top: '0.35in',
|
||||||
bottom: '0.7in',
|
bottom: '0.35in',
|
||||||
left: '0.75in',
|
left: '0.4in',
|
||||||
right: '0.75in',
|
right: '0.4in',
|
||||||
},
|
},
|
||||||
displayHeaderFooter: true,
|
displayHeaderFooter: false,
|
||||||
headerTemplate: '<div></div>',
|
|
||||||
footerTemplate: `
|
|
||||||
<div style="font-size:9px; color:#888; width:100%; text-align:center; padding:0 0.75in;">
|
|
||||||
CONFIDENTIAL — MPM Internal HR Document |
|
|
||||||
Page <span class="pageNumber"></span> of <span class="totalPages"></span>
|
|
||||||
</div>`,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return pdf;
|
return pdf;
|
||||||
|
|||||||
597
pdf/template.js
597
pdf/template.js
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user