@prefecthq/prefect-ui-library
Version:
This library is the Vue and Typescript component library for [Prefect 2](https://github.com/PrefectHQ/prefect) and [Prefect Cloud 2](https://www.prefect.io/cloud/). _The components and utilities in this project are not meant to be used independently_.
20 lines (17 loc) • 683 B
text/typescript
import { createTuple } from '@/utilities'
export const { values: deploymentStatus, isValue: isDeploymentStatus } = createTuple(['ready', 'not_ready', 'disabled'])
export type DeploymentStatus = typeof deploymentStatus[number]
export type ServerDeploymentStatus = Uppercase<typeof deploymentStatus[number]>
export function getDeploymentStatusLabel(status: DeploymentStatus): string {
switch (status) {
case 'not_ready':
return 'Not Ready'
case 'ready':
return 'Ready'
case 'disabled':
return 'Disabled'
default:
const exhaustive: never = status
throw new Error(`getDeploymentStatusLabel missing case for status: ${exhaustive}`)
}
}