mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-25 04:44:20 +00:00
38 lines
715 B
TypeScript
38 lines
715 B
TypeScript
import { Chip } from "@nextui-org/react";
|
|
import React from "react";
|
|
|
|
type Status =
|
|
| "completed"
|
|
| "pending"
|
|
| "cancelled"
|
|
| "fail"
|
|
| "success"
|
|
| "muted";
|
|
|
|
const statusColorMap: Record<
|
|
Status,
|
|
"danger" | "warning" | "success" | "default"
|
|
> = {
|
|
completed: "success",
|
|
pending: "warning",
|
|
cancelled: "danger",
|
|
fail: "danger",
|
|
success: "success",
|
|
muted: "default",
|
|
};
|
|
|
|
export const StatusBadge = ({ status }: { status: Status }) => {
|
|
const color = statusColorMap[status as keyof typeof statusColorMap];
|
|
|
|
return (
|
|
<Chip
|
|
className="capitalize border-none gap-1 text-default-600"
|
|
size="sm"
|
|
variant="flat"
|
|
color={color}
|
|
>
|
|
{status}
|
|
</Chip>
|
|
);
|
|
};
|