Navy dashboard headline banner; Arabic name for Madayn office job title

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Samer Salameh 2026-11-12 15:03:23 +03:00
parent 1dde9568b3
commit 25c79c4740
2 changed files with 8 additions and 3 deletions

View File

@ -377,7 +377,7 @@ export function Pictogram({ a, b, icons: [IconA, IconB] }: { a: Part; b: Part; i
export function Hero({ icon: Icon, label, value, parts }: { icon: ElementType; label: string; value: number; parts: Part[] }) {
return (
<Paper
sx={{ p: 2.5, color: '#fff', background: 'linear-gradient(135deg, #0b6ea8 0%, #1b8fc9 55%, #2c98d4 100%)', position: 'relative', overflow: 'hidden' }}
sx={{ p: 2.5, color: '#fff', background: 'linear-gradient(135deg, #1e4a80 0%, #28599a 55%, #3366a8 100%)', position: 'relative', overflow: 'hidden' }}
>
<Icon sx={{ position: 'absolute', insetInlineEnd: 16, top: -6, fontSize: 130, opacity: 0.12 }} />
<Stack direction="row" spacing={1.5} sx={{ alignItems: 'center', mb: 1.5, position: 'relative' }}>
@ -430,7 +430,7 @@ export function FleetInfographic({ data, lab, rtl }: { data: unknown; lab: Label
sx={{
p: 2.5,
color: '#fff',
background: 'linear-gradient(135deg, #0b6ea8 0%, #1b8fc9 55%, #2c98d4 100%)',
background: 'linear-gradient(135deg, #1e4a80 0%, #28599a 55%, #3366a8 100%)',
position: 'relative',
overflow: 'hidden',
}}

View File

@ -2,6 +2,7 @@
// (the Users grid's profession column and a user's job title). Anything unknown still gets a readable form.
const ROLES: Record<string, { en: string; ar: string }> = {
MADAYN_FIN: { en: 'Madayn finance', ar: 'مدائن - المالية' },
MADAYN_OFFICE: { en: 'Madayn office', ar: 'مكتب مدائن' },
FIN_MANAGER: { en: 'Finance manager', ar: 'مدير مالي' },
OPADMIN: { en: 'Operations administrator', ar: 'مسؤول العمليات' },
OPOFF: { en: 'Operations officer', ar: 'موظف العمليات' },
@ -12,7 +13,11 @@ const looksLikeCode = (s: string) => /^[A-Z][A-Z0-9_]{2,}$/.test(s);
/** The caption when the system has one, else our own bilingual name, else a readable form of the code. */
export function roleLabel(raw: string, caption: (k: string) => string, humanize: (k: string) => string, rtl: boolean) {
const code = raw.trim();
if (!looksLikeCode(code)) return raw;
if (!looksLikeCode(code)) {
// some sessions already carry the English name ("Madayn office") instead of the code: show our Arabic name for it
const named = rtl ? Object.values(ROLES).find((r) => r.en.toLowerCase() === code.toLowerCase()) : undefined;
return named ? named.ar : raw;
}
if (caption(code) !== code) return caption(code);
const own = ROLES[code];
return own ? (rtl ? own.ar : own.en) : humanize(code);