mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-03-26 18:31:54 +00:00
29 lines
774 B
TypeScript
29 lines
774 B
TypeScript
import { PackagePropertyPage } from "../types"
|
|
import { PropertyGroup } from "./PropertyGroup"
|
|
|
|
/**
|
|
* A Property Page will display to the user as a button with a name a description.
|
|
* Clicking the button will take the user to a nested page displaying the provided
|
|
* list of Property Groups
|
|
*/
|
|
export class PropertyPage {
|
|
private constructor(readonly data: PackagePropertyPage) {}
|
|
/**
|
|
* Returns a new Property Page with the provided options
|
|
* @param options
|
|
* @returns
|
|
*/
|
|
static of(options: {
|
|
name: string
|
|
description: string | null
|
|
groups: PropertyGroup[]
|
|
}) {
|
|
return new PropertyPage({
|
|
type: "page",
|
|
name: options.name,
|
|
description: options.description,
|
|
value: options.groups.map((x) => x.data),
|
|
})
|
|
}
|
|
}
|