Files

19 lines
847 B
TypeScript

// An organization's brand as the stylesheet layer it becomes, and the numbers behind it. A file of
// the contract because both halves of the module use it: the organization layout writes the style on
// the server (so the first paint is already branded), and the settings page's preview computes the
// same thing in the browser as a person chooses a colour. One function, so the preview cannot say
// something the page then does not do.
import { type BrandReport, themeStyle } from "@conusai-kit/brand"
import type { BrandView } from "./view.js"
export function tenantStyle(brand: Pick<BrandView, "primary" | "accent">): {
style: Record<string, string>
report: BrandReport
} {
return themeStyle({
...(brand.primary === null ? {} : { primary: brand.primary }),
...(brand.accent === null ? {} : { accent: brand.accent }),
})
}