pelagia-portal/App/components/env-banner.tsx
Hardik b592358db0 feat(app): env-gated banner (EnvBanner) for non-prod environments
Renders a thin fixed banner only when NEXT_PUBLIC_ENV_LABEL is set; production
leaves it unset so nothing shows. Used to mark the staging instance.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-19 11:56:34 +05:30

30 lines
760 B
TypeScript

// Thin fixed banner shown only when NEXT_PUBLIC_ENV_LABEL is set (e.g. staging).
// Production never sets the var, so it renders nothing there.
export function EnvBanner() {
const label = process.env.NEXT_PUBLIC_ENV_LABEL;
if (!label) return null;
return (
<div
role="status"
style={{
position: "fixed",
top: 0,
left: 0,
right: 0,
zIndex: 9999,
height: 18,
lineHeight: "18px",
textAlign: "center",
background: "#b45309",
color: "#fff",
fontSize: 11,
fontWeight: 700,
letterSpacing: "0.06em",
pointerEvents: "none",
fontFamily: "var(--font-sans), system-ui, sans-serif",
}}
>
{label}
</div>
);
}