summaryrefslogtreecommitdiff
path: root/src/jet/models/static-message-page.ts
blob: 91dafb02cbef9246c7e29c4a707b2b18ef3ae10f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { GenericPage } from '@jet-app/app-store/api/models';

const contentTypes = [
    'win-back',
    'carrier',
    'invoice',
    'contingent-price',
] as const;

export type ContentType = (typeof contentTypes)[number];

export class StaticMessagePage extends GenericPage {
    constructor({
        titleLocKey,
        contentType,
    }: {
        titleLocKey: string;
        contentType: ContentType;
    }) {
        super([]);
        this.titleLocKey = titleLocKey;
        this.contentType = contentType;
    }

    titleLocKey?: string;

    // Used to indicate which type of content the page needs to show, used to pull in the proper
    // LOC keys when rendering
    contentType: ContentType;

    // Used in our type guards to narrow a `Page` down to a `StaticMessagePage`
    pageType: string = 'staticMessagePage';
}