mirror of
https://github.com/supabase/supabase.git
synced 2026-05-31 18:03:33 +08:00
* Add flag for restore to new project * Refactor restore to new project components * Fixy
26 lines
605 B
TypeScript
26 lines
605 B
TypeScript
import { CloneStatus } from 'data/projects/clone-status-query'
|
|
import { Badge } from 'ui'
|
|
|
|
export const StatusBadge = ({
|
|
status,
|
|
}: {
|
|
status: NonNullable<CloneStatus['clones']>[number]['status']
|
|
}) => {
|
|
const statusTextMap = {
|
|
IN_PROGRESS: 'RESTORING',
|
|
COMPLETED: 'COMPLETED',
|
|
REMOVED: 'REMOVED',
|
|
FAILED: 'FAILED',
|
|
}
|
|
|
|
if (status === 'IN_PROGRESS') {
|
|
return <Badge variant="warning">{statusTextMap[status]}</Badge>
|
|
}
|
|
|
|
if (status === 'FAILED') {
|
|
return <Badge variant="destructive">{statusTextMap[status]}</Badge>
|
|
}
|
|
|
|
return <Badge>{statusTextMap[status]}</Badge>
|
|
}
|