Files
tm_panel/src/components/ui/Status.tsx
T
AmirReza Jamali 85d95530a8 feat(notifications): add notification history page and API
This commit introduces the notification history feature, allowing users to view a log of their past notifications.

Key changes include:
- Added a "Notifications" link to the sidebar with a new icon.
- Defined API endpoints for fetching notification history and details.
- Added a "sent" status variant for displaying notification status.

Additionally, this commit includes related UI improvements:
- The user's full name is now dynamically displayed in the header, replacing the hardcoded placeholder.
- Table headers are now styled in uppercase for improved readability and consistency.
2025-09-25 17:09:42 +03:30

56 lines
1.5 KiB
TypeScript

import { cn } from "@/lib/utils";
import { ReactNode } from "react";
interface IProps {
status: string;
children: ReactNode;
}
const Status = ({ status, children }: IProps) => {
const reds = [
"cancelled",
"inactive",
"rejected",
"failed",
"denied",
"blocked",
];
const greens = [
"active",
"approved",
"completed",
"success",
"verified",
"published",
"sent"
];
const blues = ["awarded", "processing", "in-review", "scheduled"];
const yellows = ["pending", "warning", "on-hold", "delayed"];
const oranges = ["expired", "expiring", "limited"];
const grays = ["draft", "disabled", "archived", "paused", "suspended"];
return (
<span
className={cn(
"flex items-center justify-center rounded-2xl px-3 py-2 text-center text-sm font-medium capitalize",
{
"bg-green text-white": greens.includes(status),
"bg-orange-light text-white": oranges.includes(status),
"bg-error text-white": reds.includes(status),
"bg-blue text-white": blues.includes(status),
"bg-gray-3 text-gray-7": grays.includes(status),
"bg-yellow-light text-yellow-dark-2": yellows.includes(status),
"bg-green-light-6 text-green-dark": status === "new",
"bg-blue-light-5 text-blue-dark": status === "info",
"bg-error-light-6 text-error-dark": status === "urgent",
"bg-primary text-white": status === "featured",
},
)}
>
{children}
</span>
);
};
export default Status;