2ec752df0c
- Create ChangeStatusForm component with status, reason, and description fields - Add change status modal to inquiries table with form integration - Implement useChangeInquiryStatus hook integration in presenter - Add edit icon button to trigger status change modal for each inquiry - Update Status component to accept status prop for proper styling - Update FormFooter component to support form submission handling - Add isChangeStatusModalOpen state management to presenter - Update TInquiries type definitions to include change status credentials - Enhance inquiries list with status change workflow alongside existing delete functionality
56 lines
1.5 KiB
TypeScript
56 lines
1.5 KiB
TypeScript
import { cn } from "@/lib/utils";
|
|
import { ReactNode } from "react";
|
|
|
|
interface IProps {
|
|
status?: string;
|
|
children: ReactNode;
|
|
}
|
|
|
|
const Status = ({ status = "draft", 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", "reviewed"];
|
|
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;
|