From d1400a6908d97989e72014b26fb9dfac656f34f9 Mon Sep 17 00:00:00 2001 From: bicochan Date: Tue, 13 May 2025 17:37:39 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20post=20=ED=8F=B4=EB=8D=94=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80(cs)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../features/src/shared/lib/use-prompt.tsx | 2 +- .../features/src/shared/providers/index.ts | 2 +- ...rompy-provider.tsx => prompt-provider.tsx} | 0 .../bbsimage/[bbsId]/[pstNo]/modify/page.tsx | 10 + .../post/bbsimage/[bbsId]/[pstNo]/page.tsx | 10 + .../post/bbsimage/[bbsId]/page.tsx | 10 + .../post/bbsimage/[bbsId]/register/page.tsx | 10 + .../bbsnormal/[bbsId]/[pstNo]/answer/page.tsx | 10 + .../bbsnormal/[bbsId]/[pstNo]/modify/page.tsx | 10 + .../post/bbsnormal/[bbsId]/[pstNo]/page.tsx | 10 + .../post/bbsnormal/[bbsId]/page.tsx | 10 + .../post/bbsnormal/[bbsId]/register/page.tsx | 10 + .../bbsnotice/[bbsId]/[pstNo]/modify/page.tsx | 10 + .../post/bbsnotice/[bbsId]/[pstNo]/page.tsx | 10 + .../post/bbsnotice/[bbsId]/page.tsx | 10 + .../post/bbsnotice/[bbsId]/register/page.tsx | 10 + apps/cs/package.json | 1 + .../attachment/api/attachment-service.ts | 15 + .../attachment/model/attachment-interface.ts | 3 + apps/cs/src/entities/board/index.ts | 3 + .../entities/board/model/board-interface.ts | 8 + apps/cs/src/entities/code/ui/code-select.tsx | 10 +- .../entities/comment/api/comment-service.ts | 60 +++ apps/cs/src/entities/comment/index.ts | 10 + .../comment/model/comment-interface.ts | 55 +++ apps/cs/src/entities/post/api/post-service.ts | 68 +++ apps/cs/src/entities/post/index.ts | 11 + .../src/entities/post/model/post-interface.ts | 85 ++++ apps/cs/src/entities/tus/index.ts | 1 + apps/cs/src/entities/tus/lib/utils.ts | 60 +++ apps/cs/src/pages/(post)/image/index.ts | 4 + .../src/pages/(post)/image/ui/create-page.tsx | 43 ++ .../src/pages/(post)/image/ui/image-page.tsx | 3 + .../src/pages/(post)/image/ui/image-post.tsx | 3 + .../src/pages/(post)/image/ui/modify-page.tsx | 53 ++ apps/cs/src/pages/(post)/normal/index.ts | 4 + .../pages/(post)/normal/ui/create-page.tsx | 51 ++ .../pages/(post)/normal/ui/modify-page.tsx | 53 ++ .../pages/(post)/normal/ui/normal-page.tsx | 3 + .../pages/(post)/normal/ui/normal-post.tsx | 3 + apps/cs/src/pages/(post)/notice/index.ts | 4 + .../notice/model/notice-table-columns.tsx | 90 ++++ .../pages/(post)/notice/ui/create-page.tsx | 46 ++ .../pages/(post)/notice/ui/modify-page.tsx | 53 ++ .../pages/(post)/notice/ui/notice-page.tsx | 3 + .../pages/(post)/notice/ui/notice-post.tsx | 3 + apps/cs/src/shared/config/api.ts | 3 + apps/cs/src/shared/lib/index.ts | 2 + apps/cs/src/shared/lib/use-prompt.tsx | 26 + .../src/shared/providers/prompt-provider.tsx | 28 ++ apps/cs/src/shared/store/menu-store.ts | 78 ++- apps/cs/src/shared/store/user-store.ts | 1 + .../cs/src/shared/ui/grid-view-data-table.tsx | 158 ++++++ apps/cs/src/widgets/post/index.ts | 3 + .../post/model/grid-view-table-columns.tsx | 123 +++++ .../widgets/post/model/post-table-columns.tsx | 141 ++++++ .../widgets/post/ui/general-file-uploader.tsx | 122 +++++ apps/cs/src/widgets/post/ui/post-action.tsx | 75 +++ apps/cs/src/widgets/post/ui/post-comment.tsx | 259 ++++++++++ apps/cs/src/widgets/post/ui/post-form.tsx | 452 ++++++++++++++++++ apps/cs/src/widgets/post/ui/post-page.tsx | 236 +++++++++ apps/cs/src/widgets/post/ui/post.tsx | 172 +++++++ .../post/ui/posting-period-selector.tsx | 86 ++++ .../post/ui/with-preview-file-uploader.tsx | 107 +++++ pnpm-lock.yaml | 3 + 65 files changed, 3010 insertions(+), 8 deletions(-) rename apps/common/features/src/shared/providers/{prompy-provider.tsx => prompt-provider.tsx} (100%) create mode 100644 apps/cs/app/(with-base-layout)/post/bbsimage/[bbsId]/[pstNo]/modify/page.tsx create mode 100644 apps/cs/app/(with-base-layout)/post/bbsimage/[bbsId]/[pstNo]/page.tsx create mode 100644 apps/cs/app/(with-base-layout)/post/bbsimage/[bbsId]/page.tsx create mode 100644 apps/cs/app/(with-base-layout)/post/bbsimage/[bbsId]/register/page.tsx create mode 100644 apps/cs/app/(with-base-layout)/post/bbsnormal/[bbsId]/[pstNo]/answer/page.tsx create mode 100644 apps/cs/app/(with-base-layout)/post/bbsnormal/[bbsId]/[pstNo]/modify/page.tsx create mode 100644 apps/cs/app/(with-base-layout)/post/bbsnormal/[bbsId]/[pstNo]/page.tsx create mode 100644 apps/cs/app/(with-base-layout)/post/bbsnormal/[bbsId]/page.tsx create mode 100644 apps/cs/app/(with-base-layout)/post/bbsnormal/[bbsId]/register/page.tsx create mode 100644 apps/cs/app/(with-base-layout)/post/bbsnotice/[bbsId]/[pstNo]/modify/page.tsx create mode 100644 apps/cs/app/(with-base-layout)/post/bbsnotice/[bbsId]/[pstNo]/page.tsx create mode 100644 apps/cs/app/(with-base-layout)/post/bbsnotice/[bbsId]/page.tsx create mode 100644 apps/cs/app/(with-base-layout)/post/bbsnotice/[bbsId]/register/page.tsx create mode 100644 apps/cs/src/entities/comment/api/comment-service.ts create mode 100644 apps/cs/src/entities/comment/index.ts create mode 100644 apps/cs/src/entities/comment/model/comment-interface.ts create mode 100644 apps/cs/src/entities/post/api/post-service.ts create mode 100644 apps/cs/src/entities/post/index.ts create mode 100644 apps/cs/src/entities/post/model/post-interface.ts create mode 100644 apps/cs/src/entities/tus/index.ts create mode 100644 apps/cs/src/entities/tus/lib/utils.ts create mode 100644 apps/cs/src/pages/(post)/image/index.ts create mode 100644 apps/cs/src/pages/(post)/image/ui/create-page.tsx create mode 100644 apps/cs/src/pages/(post)/image/ui/image-page.tsx create mode 100644 apps/cs/src/pages/(post)/image/ui/image-post.tsx create mode 100644 apps/cs/src/pages/(post)/image/ui/modify-page.tsx create mode 100644 apps/cs/src/pages/(post)/normal/index.ts create mode 100644 apps/cs/src/pages/(post)/normal/ui/create-page.tsx create mode 100644 apps/cs/src/pages/(post)/normal/ui/modify-page.tsx create mode 100644 apps/cs/src/pages/(post)/normal/ui/normal-page.tsx create mode 100644 apps/cs/src/pages/(post)/normal/ui/normal-post.tsx create mode 100644 apps/cs/src/pages/(post)/notice/index.ts create mode 100644 apps/cs/src/pages/(post)/notice/model/notice-table-columns.tsx create mode 100644 apps/cs/src/pages/(post)/notice/ui/create-page.tsx create mode 100644 apps/cs/src/pages/(post)/notice/ui/modify-page.tsx create mode 100644 apps/cs/src/pages/(post)/notice/ui/notice-page.tsx create mode 100644 apps/cs/src/pages/(post)/notice/ui/notice-post.tsx create mode 100644 apps/cs/src/shared/lib/use-prompt.tsx create mode 100644 apps/cs/src/shared/providers/prompt-provider.tsx create mode 100644 apps/cs/src/shared/ui/grid-view-data-table.tsx create mode 100644 apps/cs/src/widgets/post/index.ts create mode 100644 apps/cs/src/widgets/post/model/grid-view-table-columns.tsx create mode 100644 apps/cs/src/widgets/post/model/post-table-columns.tsx create mode 100644 apps/cs/src/widgets/post/ui/general-file-uploader.tsx create mode 100644 apps/cs/src/widgets/post/ui/post-action.tsx create mode 100644 apps/cs/src/widgets/post/ui/post-comment.tsx create mode 100644 apps/cs/src/widgets/post/ui/post-form.tsx create mode 100644 apps/cs/src/widgets/post/ui/post-page.tsx create mode 100644 apps/cs/src/widgets/post/ui/post.tsx create mode 100644 apps/cs/src/widgets/post/ui/posting-period-selector.tsx create mode 100644 apps/cs/src/widgets/post/ui/with-preview-file-uploader.tsx diff --git a/apps/common/features/src/shared/lib/use-prompt.tsx b/apps/common/features/src/shared/lib/use-prompt.tsx index 5547f004c..da9c4b386 100644 --- a/apps/common/features/src/shared/lib/use-prompt.tsx +++ b/apps/common/features/src/shared/lib/use-prompt.tsx @@ -1,5 +1,5 @@ import { useContext } from "react"; -import { PromptContext } from "../providers/prompy-provider"; +import { PromptContext } from "../providers/prompt-provider"; export const usePrompt = () => { const { message, resolve, setMessage, setResolve } = diff --git a/apps/common/features/src/shared/providers/index.ts b/apps/common/features/src/shared/providers/index.ts index f95070d0f..fa8320fe7 100644 --- a/apps/common/features/src/shared/providers/index.ts +++ b/apps/common/features/src/shared/providers/index.ts @@ -1,2 +1,2 @@ export { StoreProvider } from "./store-provider"; -export { PromptProvider } from "./prompy-provider"; +export { PromptProvider } from "./prompt-provider"; diff --git a/apps/common/features/src/shared/providers/prompy-provider.tsx b/apps/common/features/src/shared/providers/prompt-provider.tsx similarity index 100% rename from apps/common/features/src/shared/providers/prompy-provider.tsx rename to apps/common/features/src/shared/providers/prompt-provider.tsx diff --git a/apps/cs/app/(with-base-layout)/post/bbsimage/[bbsId]/[pstNo]/modify/page.tsx b/apps/cs/app/(with-base-layout)/post/bbsimage/[bbsId]/[pstNo]/modify/page.tsx new file mode 100644 index 000000000..0ae940a3e --- /dev/null +++ b/apps/cs/app/(with-base-layout)/post/bbsimage/[bbsId]/[pstNo]/modify/page.tsx @@ -0,0 +1,10 @@ +import { ModifyPage } from "@/pages/(post)/image"; + +export default async function PstBbsImagePostModifyPage({ + params, +}: { + params: Promise<{ bbsId: string; pstNo: string }>; +}) { + const { bbsId, pstNo } = await params; + return ; +} diff --git a/apps/cs/app/(with-base-layout)/post/bbsimage/[bbsId]/[pstNo]/page.tsx b/apps/cs/app/(with-base-layout)/post/bbsimage/[bbsId]/[pstNo]/page.tsx new file mode 100644 index 000000000..7b70daf45 --- /dev/null +++ b/apps/cs/app/(with-base-layout)/post/bbsimage/[bbsId]/[pstNo]/page.tsx @@ -0,0 +1,10 @@ +import { ImagePost } from "@/pages/(post)/image"; + +export default async function PstBbsImagePostPage({ + params, +}: { + params: Promise<{ bbsId: string; pstNo: string }>; +}) { + const { bbsId, pstNo } = await params; + return ; +} diff --git a/apps/cs/app/(with-base-layout)/post/bbsimage/[bbsId]/page.tsx b/apps/cs/app/(with-base-layout)/post/bbsimage/[bbsId]/page.tsx new file mode 100644 index 000000000..add5e7dde --- /dev/null +++ b/apps/cs/app/(with-base-layout)/post/bbsimage/[bbsId]/page.tsx @@ -0,0 +1,10 @@ +import { ImagePage } from "@/pages/(post)/image"; + +export default async function PstBbsImagePage({ + params, +}: { + params: Promise<{ bbsId: string }>; +}) { + const { bbsId } = await params; + return ; +} diff --git a/apps/cs/app/(with-base-layout)/post/bbsimage/[bbsId]/register/page.tsx b/apps/cs/app/(with-base-layout)/post/bbsimage/[bbsId]/register/page.tsx new file mode 100644 index 000000000..537b7f2af --- /dev/null +++ b/apps/cs/app/(with-base-layout)/post/bbsimage/[bbsId]/register/page.tsx @@ -0,0 +1,10 @@ +import { CreatePage } from "@/pages/(post)/image"; + +export default async function PstBbsImageRegisterPage({ + params, +}: { + params: Promise<{ bbsId: string }>; +}) { + const { bbsId } = await params; + return ; +} diff --git a/apps/cs/app/(with-base-layout)/post/bbsnormal/[bbsId]/[pstNo]/answer/page.tsx b/apps/cs/app/(with-base-layout)/post/bbsnormal/[bbsId]/[pstNo]/answer/page.tsx new file mode 100644 index 000000000..ad83352bc --- /dev/null +++ b/apps/cs/app/(with-base-layout)/post/bbsnormal/[bbsId]/[pstNo]/answer/page.tsx @@ -0,0 +1,10 @@ +import { CreatePage } from "@/pages/(post)/normal"; + +export default async function PstBbsNormalAnswerPage({ + params, +}: { + params: Promise<{ bbsId: string; pstNo: string }>; +}) { + const { bbsId, pstNo } = await params; + return ; +} diff --git a/apps/cs/app/(with-base-layout)/post/bbsnormal/[bbsId]/[pstNo]/modify/page.tsx b/apps/cs/app/(with-base-layout)/post/bbsnormal/[bbsId]/[pstNo]/modify/page.tsx new file mode 100644 index 000000000..25b98f655 --- /dev/null +++ b/apps/cs/app/(with-base-layout)/post/bbsnormal/[bbsId]/[pstNo]/modify/page.tsx @@ -0,0 +1,10 @@ +import { ModifyPage } from "@/pages/(post)/normal"; + +export default async function PstBbsNormalPostModifyPage({ + params, +}: { + params: Promise<{ bbsId: string; pstNo: string }>; +}) { + const { bbsId, pstNo } = await params; + return ; +} diff --git a/apps/cs/app/(with-base-layout)/post/bbsnormal/[bbsId]/[pstNo]/page.tsx b/apps/cs/app/(with-base-layout)/post/bbsnormal/[bbsId]/[pstNo]/page.tsx new file mode 100644 index 000000000..17d7c35cb --- /dev/null +++ b/apps/cs/app/(with-base-layout)/post/bbsnormal/[bbsId]/[pstNo]/page.tsx @@ -0,0 +1,10 @@ +import { NormalPost } from "@/pages/(post)/normal"; + +export default async function PstBbsNormalPostPage({ + params, +}: { + params: Promise<{ bbsId: string; pstNo: string }>; +}) { + const { bbsId, pstNo } = await params; + return ; +} diff --git a/apps/cs/app/(with-base-layout)/post/bbsnormal/[bbsId]/page.tsx b/apps/cs/app/(with-base-layout)/post/bbsnormal/[bbsId]/page.tsx new file mode 100644 index 000000000..b1e4a9318 --- /dev/null +++ b/apps/cs/app/(with-base-layout)/post/bbsnormal/[bbsId]/page.tsx @@ -0,0 +1,10 @@ +import { NormalPage } from "@/pages/(post)/normal"; + +export default async function PstBbsNormalPage({ + params, +}: { + params: Promise<{ bbsId: string }>; +}) { + const { bbsId } = await params; + return ; +} diff --git a/apps/cs/app/(with-base-layout)/post/bbsnormal/[bbsId]/register/page.tsx b/apps/cs/app/(with-base-layout)/post/bbsnormal/[bbsId]/register/page.tsx new file mode 100644 index 000000000..9f7fe74cc --- /dev/null +++ b/apps/cs/app/(with-base-layout)/post/bbsnormal/[bbsId]/register/page.tsx @@ -0,0 +1,10 @@ +import { CreatePage } from "@/pages/(post)/normal"; + +export default async function PstBbsNormalRegisterPage({ + params, +}: { + params: Promise<{ bbsId: string }>; +}) { + const { bbsId } = await params; + return ; +} diff --git a/apps/cs/app/(with-base-layout)/post/bbsnotice/[bbsId]/[pstNo]/modify/page.tsx b/apps/cs/app/(with-base-layout)/post/bbsnotice/[bbsId]/[pstNo]/modify/page.tsx new file mode 100644 index 000000000..8ee233879 --- /dev/null +++ b/apps/cs/app/(with-base-layout)/post/bbsnotice/[bbsId]/[pstNo]/modify/page.tsx @@ -0,0 +1,10 @@ +import { ModifyPage } from "@/pages/(post)/notice"; + +export default async function PstBbsNoticePostModifyPage({ + params, +}: { + params: Promise<{ bbsId: string; pstNo: string }>; +}) { + const { bbsId, pstNo } = await params; + return ; +} diff --git a/apps/cs/app/(with-base-layout)/post/bbsnotice/[bbsId]/[pstNo]/page.tsx b/apps/cs/app/(with-base-layout)/post/bbsnotice/[bbsId]/[pstNo]/page.tsx new file mode 100644 index 000000000..5e080048b --- /dev/null +++ b/apps/cs/app/(with-base-layout)/post/bbsnotice/[bbsId]/[pstNo]/page.tsx @@ -0,0 +1,10 @@ +import { NoticePost } from "@/pages/(post)/notice"; + +export default async function PstBbsNoticePostPage({ + params, +}: { + params: Promise<{ bbsId: string; pstNo: string }>; +}) { + const { bbsId, pstNo } = await params; + return ; +} diff --git a/apps/cs/app/(with-base-layout)/post/bbsnotice/[bbsId]/page.tsx b/apps/cs/app/(with-base-layout)/post/bbsnotice/[bbsId]/page.tsx new file mode 100644 index 000000000..7694f9005 --- /dev/null +++ b/apps/cs/app/(with-base-layout)/post/bbsnotice/[bbsId]/page.tsx @@ -0,0 +1,10 @@ +import { NoticePage } from "@/pages/(post)/notice"; + +export default async function PstBbsNoticePage({ + params, +}: { + params: Promise<{ bbsId: string }>; +}) { + const { bbsId } = await params; + return ; +} diff --git a/apps/cs/app/(with-base-layout)/post/bbsnotice/[bbsId]/register/page.tsx b/apps/cs/app/(with-base-layout)/post/bbsnotice/[bbsId]/register/page.tsx new file mode 100644 index 000000000..6ea34f58f --- /dev/null +++ b/apps/cs/app/(with-base-layout)/post/bbsnotice/[bbsId]/register/page.tsx @@ -0,0 +1,10 @@ +import { CreatePage } from "@/pages/(post)/notice"; + +export default async function PstBbsNoticeRegisterPage({ + params, +}: { + params: Promise<{ bbsId: string }>; +}) { + const { bbsId } = await params; + return ; +} diff --git a/apps/cs/package.json b/apps/cs/package.json index 6e5f62b96..4c7e50176 100644 --- a/apps/cs/package.json +++ b/apps/cs/package.json @@ -15,6 +15,7 @@ "@frontend-opensource/use-react-hooks": "^1.1.4", "@hookform/resolvers": "^4.1.3", "@minoru/react-dnd-treeview": "3.5.1-alpha.1", + "@radix-ui/react-icons": "^1.3.2", "@radix-ui/react-label": "^2.1.2", "@radix-ui/react-slot": "^1.1.2", "@tanstack/react-query": "^5.67.1", diff --git a/apps/cs/src/entities/attachment/api/attachment-service.ts b/apps/cs/src/entities/attachment/api/attachment-service.ts index f956f6580..406cca549 100644 --- a/apps/cs/src/entities/attachment/api/attachment-service.ts +++ b/apps/cs/src/entities/attachment/api/attachment-service.ts @@ -1,3 +1,4 @@ +import type { AxiosResponse } from "axios"; import { client } from "@/shared/api"; import { ENDPOINT } from "@/shared/config"; import type { @@ -42,6 +43,10 @@ export class AttachmentApiService implements AttachmentService { return URL.createObjectURL(blob); } + public async deleteAttachmentByAtflId(atflId: string): Promise { + await client.delete(`${ENDPOINT.ATTACH_SERVICE.ATTACHMENTS}/${atflId}`); + } + public async getImageUrlByAtflCd(atflCd: string): Promise { if (!atflCd) return ""; const response = await fetch( @@ -50,6 +55,16 @@ export class AttachmentApiService implements AttachmentService { const blob = await response.blob(); return URL.createObjectURL(blob); } + + public async downloadAttachmentByAtflCd( + atflCd: string, + ): Promise { + const response = await client.get( + `${ENDPOINT.ATTACH_SERVICE.DOWNLOAD}/${atflCd}`, + { responseType: "blob" }, + ); + return response; + } } export const AttachmentApi = new AttachmentApiService(); diff --git a/apps/cs/src/entities/attachment/model/attachment-interface.ts b/apps/cs/src/entities/attachment/model/attachment-interface.ts index 5133e4a72..00340e9ae 100644 --- a/apps/cs/src/entities/attachment/model/attachment-interface.ts +++ b/apps/cs/src/entities/attachment/model/attachment-interface.ts @@ -1,3 +1,4 @@ +import type { AxiosResponse } from "axios"; import type { PageableList, PageableParams } from "@/shared/model"; export interface AttachmentParams extends PageableParams { @@ -36,7 +37,9 @@ export interface AttachmentService { getAttachmentsList: (params: AttachmentParams) => Promise; getAttachmentsInfo: (atflCd: string) => Promise; deleteAttachment: (atflId: string) => Promise; + deleteAttachmentByAtflId: (atflId: string) => Promise; deleteAttachmentByAtflCd: (atflCd: string) => Promise; getImageUrl: (atflId: string) => Promise; getImageUrlByAtflCd: (atflCd: string) => Promise; + downloadAttachmentByAtflCd: (atflCd: string) => Promise; } diff --git a/apps/cs/src/entities/board/index.ts b/apps/cs/src/entities/board/index.ts index a4be9eb12..e28ee59f6 100644 --- a/apps/cs/src/entities/board/index.ts +++ b/apps/cs/src/entities/board/index.ts @@ -1,9 +1,12 @@ export { BoardApi } from "./api/board-service"; export { boardFormSchema, + BOARD_POSTING_CODE, type Board, + type BoardType, type BoardFormData, type BoardParams, type BoardPopup, + type BoardPostingCode, } from "./model/board-interface"; export { BoardTemplateApi } from "./api/board-template-service"; diff --git a/apps/cs/src/entities/board/model/board-interface.ts b/apps/cs/src/entities/board/model/board-interface.ts index 1ed8f1d9f..565b998fb 100644 --- a/apps/cs/src/entities/board/model/board-interface.ts +++ b/apps/cs/src/entities/board/model/board-interface.ts @@ -8,7 +8,15 @@ export const BOARD_TYPE = { BBSMOVIE: "BBSMOVIE", } as const; +export const BOARD_POSTING_CODE = { + 팝업게시: "01", + 상단게시: "02", + 기간게시: "03", +} as const; + export type BoardType = (typeof BOARD_TYPE)[keyof typeof BOARD_TYPE]; +export type BoardPostingCode = + (typeof BOARD_POSTING_CODE)[keyof typeof BOARD_POSTING_CODE]; export interface BoardParams extends PageableParams { keywordType?: string; diff --git a/apps/cs/src/entities/code/ui/code-select.tsx b/apps/cs/src/entities/code/ui/code-select.tsx index bd175a8a9..441f334e3 100644 --- a/apps/cs/src/entities/code/ui/code-select.tsx +++ b/apps/cs/src/entities/code/ui/code-select.tsx @@ -11,9 +11,15 @@ import { CodeApi } from "../api/code-service"; type CodeSelectProps = { upCd: string; + placeholder?: string; } & React.ComponentPropsWithoutRef; -function CodeSelect({ upCd, defaultValue, ...props }: CodeSelectProps) { +function CodeSelect({ + upCd, + defaultValue, + placeholder = "선택", + ...props +}: CodeSelectProps) { const { data: code } = useQuery({ queryKey: [ENDPOINT.CMS_SERVICE.CODE, upCd], queryFn: () => CodeApi.getCode(upCd), @@ -21,7 +27,7 @@ function CodeSelect({ upCd, defaultValue, ...props }: CodeSelectProps) { }); const defaultValueText = - code?.find((item) => item.lwpoCd === defaultValue)?.lwpoCdNm ?? "선택"; + code?.find((item) => item.lwpoCd === defaultValue)?.lwpoCdNm ?? placeholder; return (