mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-28 06:14:20 +00:00
* feat(users): Add in Users page and sidebar * feat(users): Fix grammar, add in Users action * feat(users): Add in more API info * feat(users): Continue work on table, pass data through to table, style skeleton * feat(users): Format Status column * feat(users): Style table * feat(users): Change data, update Users to User
42 lines
787 B
TypeScript
42 lines
787 B
TypeScript
import { Chip } from "@nextui-org/react";
|
|
import React from "react";
|
|
|
|
type Status =
|
|
| "completed"
|
|
| "pending"
|
|
| "cancelled"
|
|
| "fail"
|
|
| "success"
|
|
| "muted"
|
|
| "active"
|
|
| "inactive";
|
|
|
|
const statusColorMap: Record<
|
|
Status,
|
|
"danger" | "warning" | "success" | "default"
|
|
> = {
|
|
completed: "success",
|
|
pending: "warning",
|
|
cancelled: "danger",
|
|
fail: "danger",
|
|
success: "success",
|
|
muted: "default",
|
|
active: "success",
|
|
inactive: "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>
|
|
);
|
|
};
|