diff --git a/apps/cs/src/entities/user/index.ts b/apps/cs/src/entities/user/index.ts index 7b4615e01..8927256f9 100644 --- a/apps/cs/src/entities/user/index.ts +++ b/apps/cs/src/entities/user/index.ts @@ -4,6 +4,7 @@ export { userSaveSchema, userPasswordUpdateSchema, userUpdateSchema, + type UserStateCode, type UserSearchParams, type UserListResponse, type UserSaveData, diff --git a/apps/cs/src/entities/user/model/user-interface.ts b/apps/cs/src/entities/user/model/user-interface.ts index 69320e8c7..012fe9e92 100644 --- a/apps/cs/src/entities/user/model/user-interface.ts +++ b/apps/cs/src/entities/user/model/user-interface.ts @@ -9,7 +9,8 @@ export const USER_STATE_CODE = { 삭제: "09", } as const; -type UserStateCode = (typeof USER_STATE_CODE)[keyof typeof USER_STATE_CODE]; +export type UserStateCode = + (typeof USER_STATE_CODE)[keyof typeof USER_STATE_CODE]; // 사용자 검색 파라미터 export interface UserSearchParams extends PageableParams { diff --git a/apps/cs/src/pages/users/model/table-columns.tsx b/apps/cs/src/pages/users/model/table-columns.tsx index 0b61b0569..1aad6de27 100644 --- a/apps/cs/src/pages/users/model/table-columns.tsx +++ b/apps/cs/src/pages/users/model/table-columns.tsx @@ -1,6 +1,11 @@ import dayjs from "dayjs"; import type { ColumnDef } from "@tanstack/react-table"; -import type { UserListResponse } from "@/entities/user"; +import { + USER_STATE_CODE, + type UserListResponse, + type UserStateCode, +} from "@/entities/user"; +import { Badge } from "@common/components"; export const columns: ColumnDef[] = [ { @@ -42,8 +47,11 @@ export const columns: ColumnDef[] = [ header: "기관/부서", }, { - accessorKey: "userStateCodeName", + accessorKey: "userStateCode", header: "회원상태", + cell: ({ row }) => { + return getUserStateBadge(row.original.userStateCode); + }, }, { accessorKey: "aprvYmd", @@ -63,3 +71,18 @@ export const columns: ColumnDef[] = [ }, }, ]; + +const getUserStateBadge = (userStateCode: UserStateCode) => { + switch (userStateCode) { + case USER_STATE_CODE.대기: + return 대기; + case USER_STATE_CODE.정상: + return 정상; + case USER_STATE_CODE.정지: + return 정지; + case USER_STATE_CODE.탈퇴: + return 탈퇴; + case USER_STATE_CODE.삭제: + return 삭제; + } +}; diff --git a/apps/cs/src/pages/users/ui/create-page.tsx b/apps/cs/src/pages/users/ui/create-page.tsx index f58469327..2d55a1cd2 100644 --- a/apps/cs/src/pages/users/ui/create-page.tsx +++ b/apps/cs/src/pages/users/ui/create-page.tsx @@ -16,20 +16,11 @@ function CreatePage() { defaultValues: { userId: "", userName: "", - email: "", password: "", pswdHnt: "", - pswdAns: "", - mphn: "", - telno: "", - zip: "", - addr: "", - daddr: "", laeSeCd: "", ogdpSeCd: "", expryYmd: "", - instSeCd: "", - enoCd: "", }, });