0a33497d40
Initial commit of the Super-Admin web panel (Next.js + TypeScript). CI admin-web-check job was failing because the directory was never tracked in git. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
68 lines
1.5 KiB
TypeScript
68 lines
1.5 KiB
TypeScript
"use client";
|
|
|
|
import { useTranslations } from "next-intl";
|
|
import { Badge } from "@/components/ui/badge";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
export type TicketStatus =
|
|
| "Open"
|
|
| "InProgress"
|
|
| "WaitingMerchant"
|
|
| "Resolved"
|
|
| "Closed"
|
|
| string;
|
|
|
|
export function isTicketClosed(status: TicketStatus): boolean {
|
|
return status === "Closed" || status === "Resolved";
|
|
}
|
|
|
|
export function TicketStatusBadge({
|
|
status,
|
|
className,
|
|
}: {
|
|
status: TicketStatus;
|
|
className?: string;
|
|
}) {
|
|
const t = useTranslations("support.status");
|
|
|
|
const label = (() => {
|
|
switch (status) {
|
|
case "Open":
|
|
return t("open");
|
|
case "InProgress":
|
|
return t("inProgress");
|
|
case "WaitingMerchant":
|
|
return t("waitingMerchant");
|
|
case "Resolved":
|
|
return t("resolved");
|
|
case "Closed":
|
|
return t("closed");
|
|
default:
|
|
return status;
|
|
}
|
|
})();
|
|
|
|
const styles = (() => {
|
|
switch (status) {
|
|
case "Open":
|
|
return "bg-amber-100 text-amber-900 border-amber-200";
|
|
case "InProgress":
|
|
return "bg-blue-100 text-blue-900 border-blue-200";
|
|
case "WaitingMerchant":
|
|
return "bg-[#E1F5EE] text-[#0F6E56] border-[#0F6E56]/20";
|
|
case "Resolved":
|
|
return "bg-muted text-muted-foreground";
|
|
case "Closed":
|
|
return "bg-muted text-muted-foreground";
|
|
default:
|
|
return "";
|
|
}
|
|
})();
|
|
|
|
return (
|
|
<Badge variant="outline" className={cn("border font-normal", styles, className)}>
|
|
{label}
|
|
</Badge>
|
|
);
|
|
}
|