/* EXAMPLE ONLY: an extract from the Superbill Review prototype, kept as reference for porting. ECW/eClinicalWorks, Tebra, 'Example Client', SPB_* tables and patient/ticket wording are that project's examples. Don't copy them into a new project. */
import { ThemeSwitcher } from '../theme'
import { ROLE_LABEL } from '../auth'
/**
* The app shell's top bar: brand mark, title, and the signed-in user's
* controls. The board tab strip that used to live below it is now the left
* sidebar (`Sidebar.tsx`) — this component no longer owns navigation.
*
* The gradient is the one saturated surface in the product. Everything on it
* is white or a white alpha rather than a palette token, because a
* token-coloured control on the band reads as a hole punched through it —
* see `.sb-appbar` and `.sb-ghost-btn` in index.css.
*/
/** 'admin' is never a single global role any more — computed here from the
* two per-project flags so the header names exactly what this account can
* reach, rather than falling back to "Operator" for someone who is in fact
* an admin of one or both projects. */
function roleLabel(user: {
role: string
ecw_role?: string | null
tebra_role?: string | null
}): string {
if (user.role === 'super_admin') return ROLE_LABEL.super_admin
const ecw = user.ecw_role === 'admin'
const tebra = user.tebra_role === 'admin'
if (ecw && tebra) return 'Admin · Both'
if (ecw) return 'Admin · ECW'
if (tebra) return 'Admin · Tebra'
return ROLE_LABEL.operator
}
export function BrandHeader({
user,
onLogout,
sidebarOpen,
onToggleSidebar,
}: {
user: {
username: string
real_name: string | null
role: string
ecw_role?: string | null
tebra_role?: string | null
}
onLogout: () => void
/** Present only on screens that have the left sidebar. */
sidebarOpen?: boolean
onToggleSidebar?: () => void
}) {
return (
{onToggleSidebar && (
)}
{/* What the tool is, matching the browser tab and the sign-in screen.
The brand and EMR edition — "Superbill Automation for ECW" — live in
the sidebar's own group headers instead (`Sidebar.tsx`), which is
where the rail has room to state them without competing here. */}
)
}
/**
* The product mark: shield plus three ascending bars, drawn as vector.
*
* The same artwork the sign-in screen carries, so the two screens read as one
* product — but flat here, with no bob and no glow: on the sign-in screen it
* is the subject, and in a header it is a label for the page.
*
* Vector rather than the `logo-mark.png` raster it replaced. The raster could
* not take the header's drop-shadow without fringing along its antialiased
* edge, and it could not follow a theme.
*
* Colours are literal on purpose. The shield and its bars are artwork — the
* mark is the same mark in light and dark, the way a printed logo is — so
* these four values are deliberately NOT theme tokens. `--shield`, `--clean`,
* `--verify` and `--review` hold the same hexes for anything that needs to
* reference them.
*
* `aria-hidden` because the product is named in text immediately beside it.
*/
export function ShieldMark({ size = 34 }: { size?: number }) {
return (
)
}