diff --git a/frontend/src/features/org/org-status-banner.ts b/frontend/src/features/org/org-status-banner.ts index d673470dc7..151f74d9fc 100644 --- a/frontend/src/features/org/org-status-banner.ts +++ b/frontend/src/features/org/org-status-banner.ts @@ -1,5 +1,5 @@ import { localized, msg, str } from "@lit/localize"; -import type { SlAlert } from "@shoelace-style/shoelace"; +import type { SlAlert, SlIcon } from "@shoelace-style/shoelace"; import { differenceInHours } from "date-fns/fp"; import { html, type TemplateResult } from "lit"; import { customElement } from "lit/decorators.js"; @@ -18,6 +18,24 @@ type Alert = { }; }; +const iconForVariant = ( + variant: SlAlert["variant"], +): NonNullable => { + switch (variant) { + case "danger": + return "exclamation-triangle"; + case "success": + return "check2-circle"; + case "warning": + return "exclamation-diamond"; + default: + return "info-circle"; + } +}; + +// show banner as warning if <= this many days of trial is left +const TRIAL_DAYS_LEFT_SHOW_WARNING = 4; + @customElement("btrix-org-status-banner") @localized() export class OrgStatusBanner extends BtrixElement { @@ -29,12 +47,13 @@ export class OrgStatusBanner extends BtrixElement { if (!alert) return; const content = alert.content(); + const variant = alert.variant || "danger"; return html`