mega-plant/components/BuildStamp.tsx
Dave ceca743e58 feat: show the build commit as a faint corner mark
Declares ARG NEXT_PUBLIC_APP_COMMIT, supplied by Ship, and renders it as a
nearly transparent, click-through stamp. Renders nothing when unset.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 01:27:22 +02:00

32 lines
879 B
TypeScript

/**
* The commit this build came from, as a faint mark in the corner.
*
* `NEXT_PUBLIC_APP_COMMIT` is set by Ship (the Forgejo Desktop app) when it
* builds the image. A build made any other way has no value, so nothing is
* rendered. It never takes a click and is nearly transparent.
*/
export function BuildStamp() {
const commit = process.env.NEXT_PUBLIC_APP_COMMIT;
if (!commit) return null;
return (
<div
aria-hidden="true"
title={`Build ${commit}`}
style={{
position: "fixed",
right: 6,
bottom: "calc(env(safe-area-inset-bottom, 0px) + 3px)",
zIndex: 2147483647,
fontSize: 9,
lineHeight: 1,
fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
opacity: 0.3,
pointerEvents: "none",
userSelect: "none",
}}
>
{commit}
</div>
);
}