mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 09:55:06 +03:00
* Move all studio files from /studio to /apps/studio. * Move studio specific prettier ignores. * Fix the ui references from studio. * Fix the css imports. * Fix all package.json issues. * Fix the prettier setup for the studio app. * Add .turbo folder to prettierignore. * Fix the github workflows.
35 lines
814 B
TypeScript
35 lines
814 B
TypeScript
import { PROJECT_STATUS } from 'lib/constants'
|
|
import { Project } from 'types'
|
|
|
|
export const inferProjectStatus = (project: Project) => {
|
|
let status = undefined
|
|
switch (project.status) {
|
|
case PROJECT_STATUS.ACTIVE_HEALTHY:
|
|
status = 'isHealthy'
|
|
break
|
|
case PROJECT_STATUS.GOING_DOWN:
|
|
case PROJECT_STATUS.PAUSING:
|
|
status = 'isPausing'
|
|
break
|
|
case PROJECT_STATUS.INACTIVE:
|
|
status = 'isPaused'
|
|
break
|
|
case PROJECT_STATUS.RESTORING:
|
|
status = 'isRestoring'
|
|
break
|
|
case PROJECT_STATUS.UNKNOWN:
|
|
case PROJECT_STATUS.COMING_UP:
|
|
status = 'isComingUp'
|
|
break
|
|
}
|
|
return status as InferredProjectStatus
|
|
}
|
|
|
|
export type InferredProjectStatus =
|
|
| 'isHealthy'
|
|
| 'isPausing'
|
|
| 'isPaused'
|
|
| 'isRestoring'
|
|
| 'isComingUp'
|
|
| undefined
|