mirror of
https://github.com/supabase/supabase.git
synced 2026-06-14 05:06:27 +08:00
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
27 lines
608 B
TypeScript
27 lines
608 B
TypeScript
import { Badge } from 'ui'
|
|
|
|
import { CloneStatus } from '@/data/projects/clone-status-query'
|
|
|
|
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>
|
|
}
|