mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
adding pagination.
This commit is contained in:
@@ -1,23 +1,33 @@
|
||||
import React from "types-react";
|
||||
import {Badge} from "@/components/ui/badge";
|
||||
import {cn} from "@/lib/utils";
|
||||
|
||||
export type cardsWithPaginationProps = {
|
||||
status: "waiting" | "ongoing" | "failed" | "success";
|
||||
export type statusBadgeProps = {
|
||||
status: "pending" | "processing" | "success" | "failed"
|
||||
}
|
||||
|
||||
|
||||
export const StatusBadge = ({status}: cardsWithPaginationProps) => {
|
||||
export const StatusBadge = ({status}: statusBadgeProps) => {
|
||||
|
||||
let style = "";
|
||||
|
||||
switch (status) {
|
||||
case 'waiting':
|
||||
return <Badge variant="outline" className="text-yellow-500 border-2 border-yellow-500">waiting</Badge>
|
||||
case 'ongoing':
|
||||
return <Badge variant="outline" className="text-orange-500 border-2 border-orange-500">ongoing</Badge>
|
||||
case 'pending':
|
||||
style = "text-yellow-500 border-yellow-500"
|
||||
break
|
||||
case 'processing':
|
||||
style = "text-orange-500 border-orange-500"
|
||||
break
|
||||
case 'failed':
|
||||
return <Badge variant="outline" className="text-red-500 border-2 border-red-500">failed</Badge>
|
||||
style = "text-red-500 border-red-500"
|
||||
break
|
||||
case 'success':
|
||||
return <Badge variant="outline" className="text-green-500 border-2 border-green-500">success</Badge>
|
||||
style = "text-green-500 border-green-500"
|
||||
break
|
||||
default:
|
||||
throw Error
|
||||
}
|
||||
|
||||
return (
|
||||
<Badge variant="outline" className={cn("w-20 border-2 justify-center")}>{status}</Badge>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user