feat: show build SHA + timestamp in a small footer for deploy verification
Adds a BuildStamp component pinned to the bottom-right of every page (desktop only, dim monospace text) so it's obvious at a glance which build is currently running. The git short SHA and an ISO build timestamp are injected at build time via Vite's `define`, falling back to 'unknown' if git is not available. ESLint config declares the two compile-time constants as readonly globals so no per-file disable comments are needed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
19
src/components/ui/BuildStamp.jsx
Normal file
19
src/components/ui/BuildStamp.jsx
Normal file
@@ -0,0 +1,19 @@
|
||||
const sha = typeof __BUILD_SHA__ === 'string' ? __BUILD_SHA__ : 'dev';
|
||||
const time = typeof __BUILD_TIME__ === 'string' ? __BUILD_TIME__ : new Date().toISOString();
|
||||
|
||||
const formatted = (() => {
|
||||
const d = new Date(time);
|
||||
if (Number.isNaN(d.getTime())) return time;
|
||||
return d.toLocaleString('nl-NL', { dateStyle: 'short', timeStyle: 'short' });
|
||||
})();
|
||||
|
||||
const BuildStamp = () => (
|
||||
<div
|
||||
className="hidden md:block fixed bottom-1 right-2 text-[10px] font-mono text-fg-muted/60 z-40 pointer-events-none select-none"
|
||||
title={`Build ${sha} at ${time}`}
|
||||
>
|
||||
v{sha} · {formatted}
|
||||
</div>
|
||||
);
|
||||
|
||||
export default BuildStamp;
|
||||
Reference in New Issue
Block a user