상태 변경 모달 수정

This commit is contained in:
dohyeons 2025-08-26 11:10:34 +09:00
parent 543052a4aa
commit 65d648d30b
1 changed files with 16 additions and 8 deletions

View File

@ -7,7 +7,7 @@ import {
DialogTitle,
} from "@/components/ui/dialog";
import { Button } from "@/components/ui/button";
import { User } from "@/types/user";
import { User, USER_STATUS_LABELS } from "@/types/user";
interface UserStatusConfirmDialogProps {
user: User | null;
@ -29,8 +29,12 @@ export function UserStatusConfirmDialog({
}: UserStatusConfirmDialogProps) {
if (!user) return null;
const statusText = newStatus === "active" ? "활성" : "비활성";
const statusColor = newStatus === "active" ? "text-blue-600" : "text-gray-600";
// 현재 상태와 새로운 상태의 텍스트 및 색상
const currentStatusText = USER_STATUS_LABELS[user.status as keyof typeof USER_STATUS_LABELS] || user.status;
const newStatusText = USER_STATUS_LABELS[newStatus as keyof typeof USER_STATUS_LABELS] || newStatus;
const currentStatusColor = user.status === "active" ? "text-blue-600" : "text-gray-600";
const newStatusColor = newStatus === "active" ? "text-blue-600" : "text-gray-600";
return (
<Dialog open={isOpen} onOpenChange={(open) => !open && onCancel()}>
@ -41,16 +45,20 @@ export function UserStatusConfirmDialog({
</DialogHeader>
<div className="py-4">
<div className="space-y-2">
<div className="space-y-3">
<div className="flex items-center gap-2">
<span className="text-muted-foreground text-sm">:</span>
<span className="text-muted-foreground w-16 text-sm">:</span>
<span className="font-medium">
{user.user_name} ({user.user_id})
{user.userName} ({user.userId})
</span>
</div>
<div className="flex items-center gap-2">
<span className="text-muted-foreground text-sm"> :</span>
<span className={`font-medium ${statusColor}`}>{statusText}</span>
<span className="text-muted-foreground w-16 text-sm"> :</span>
<div className="flex items-center gap-2">
<span className={`font-medium ${currentStatusColor}`}>{currentStatusText}</span>
<span className="text-muted-foreground"></span>
<span className={`font-medium ${newStatusColor}`}>{newStatusText}</span>
</div>
</div>
</div>
</div>