Files
prowler/components/ui/table/StatusBadge.tsx
T
Pablo Lara 48f633889a Providers page table (#20)
* fix: add suppressHydrationWarning to resolve console errors

* chore: add server-only library

* WIP: Mock API for providers and start rendering data

* chore: relocate utils folder to proper directory

* chore: install shadcn for tables, adding sttings page

* refactor: improve sidebar display behavior

* chore: add fake data to the dataProviders

* chore: remove the old table and rename ProviderInfo component

* refactor: improve sidebar display behavior adding a custom hook

* feat: the Providers table is rendering real data

* chore: set the default valuef or isCollapse to false

* chore: Added a helper function getProviderAttributes for cleaner access to provider attributes
2024-07-30 00:04:54 -05:00

26 lines
621 B
TypeScript

import { Chip } from "@nextui-org/react";
import React from "react";
type Status = "completed" | "pending" | "cancelled";
export const statusColorMap: Record<Status, "success" | "danger" | "warning"> =
{
completed: "success",
pending: "warning",
cancelled: "danger",
};
export const StatusBadge = ({ status }: { status: Status }) => {
return (
<Chip
className="capitalize border-none gap-1 text-default-600"
// eslint-disable-next-line security/detect-object-injection
color={statusColorMap[status]}
size="sm"
variant="flat"
>
{status}
</Chip>
);
};