121 lines
4.5 KiB
JavaScript
121 lines
4.5 KiB
JavaScript
(function () {
|
|
const OrgPortal = (window.OrgPortal = window.OrgPortal || {});
|
|
const { h } = OrgPortal.runtime;
|
|
const { portalData } = OrgPortal.data;
|
|
const store = OrgPortal.store;
|
|
const actions = OrgPortal.actions;
|
|
|
|
OrgPortal.componentFns = OrgPortal.componentFns || {};
|
|
|
|
OrgPortal.componentFns.OverviewCard = function OverviewCard() {
|
|
const MetricCard = OrgPortal.componentFns.MetricCard;
|
|
const readiness = actions.getAssetReadiness();
|
|
const headquarters = portalData.org.headquarters || "ArmA Verse";
|
|
|
|
return h(
|
|
"section",
|
|
{ className: "card org-panel org-span-12" },
|
|
h(
|
|
"div",
|
|
{ className: "org-panel-head" },
|
|
h(
|
|
"div",
|
|
null,
|
|
h("div", { className: "org-eyebrow" }, portalData.org.tag),
|
|
h(
|
|
"h2",
|
|
{ className: "org-panel-title" },
|
|
"Organization Overview",
|
|
),
|
|
),
|
|
),
|
|
h(
|
|
"div",
|
|
{ className: "org-hero-grid" },
|
|
h(
|
|
"div",
|
|
{ className: "org-hero-copy" },
|
|
h(
|
|
"p",
|
|
{ className: "org-summary" },
|
|
portalData.org.type,
|
|
" operating from ",
|
|
headquarters,
|
|
". Treasury, fleet status, inventory, and roster management are surfaced here first.",
|
|
),
|
|
h(
|
|
"div",
|
|
{ className: "org-meta-row" },
|
|
h(
|
|
"div",
|
|
{ className: "org-meta-item" },
|
|
h(
|
|
"span",
|
|
{ className: "org-meta-label" },
|
|
"Director",
|
|
),
|
|
h(
|
|
"span",
|
|
{ className: "org-meta-value" },
|
|
actions.formatDisplayName(portalData.org.owner),
|
|
),
|
|
),
|
|
h(
|
|
"div",
|
|
{ className: "org-meta-item" },
|
|
h(
|
|
"span",
|
|
{ className: "org-meta-label" },
|
|
"Active Members",
|
|
),
|
|
h(
|
|
"span",
|
|
{ className: "org-meta-value" },
|
|
`${store.getMembers().length} total`,
|
|
),
|
|
),
|
|
h(
|
|
"div",
|
|
{ className: "org-meta-item" },
|
|
h(
|
|
"span",
|
|
{ className: "org-meta-label" },
|
|
"Fleet Readiness",
|
|
),
|
|
h(
|
|
"span",
|
|
{ className: "org-meta-value" },
|
|
readiness === null ? "N/A" : `${readiness}%`,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
h(
|
|
"div",
|
|
{ className: "org-metric-grid" },
|
|
MetricCard(
|
|
"Org Funds",
|
|
actions.formatCurrency(store.getFunds()),
|
|
"Organization treasury balance",
|
|
),
|
|
MetricCard(
|
|
"Reputation",
|
|
portalData.reputation,
|
|
"Organization standing",
|
|
),
|
|
MetricCard(
|
|
"Asset Lines",
|
|
portalData.assets.length,
|
|
"Tracked supply and equipment entries",
|
|
),
|
|
MetricCard(
|
|
"Fleet Vehicles",
|
|
portalData.fleet.length,
|
|
"Tracked air, ground, and naval vehicles",
|
|
),
|
|
),
|
|
),
|
|
);
|
|
};
|
|
})();
|