adding pagination.

This commit is contained in:
killian-larcher
2024-11-11 14:56:33 +01:00
parent cfd8803b16
commit e181e4edbb
14 changed files with 575 additions and 176 deletions
+20 -10
View File
@@ -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>
)
}