[as] feat: 결재선 관리 페이지 구현

This commit is contained in:
2026-05-18 17:40:21 +09:00
parent 0e067bb5fc
commit 25affc06b9
43 changed files with 2071 additions and 236 deletions
@@ -0,0 +1,50 @@
"use client";
import {
cn,
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@common/components";
import { useCodeList, useCodeListByUseYn } from "../api/queries";
interface CodeSelectProps extends React.ComponentPropsWithoutRef<typeof Select> {
upCd: string;
useYn?: string;
placeholder?: string;
className?: string;
}
function CodeSelect({
upCd,
useYn,
placeholder = "선택",
className,
...props
}: CodeSelectProps) {
const listQuery = useCodeList(useYn ? undefined : upCd);
const listByUseYnQuery = useCodeListByUseYn(useYn ? upCd : undefined, useYn ?? "");
const codes = useYn ? listByUseYnQuery.data : listQuery.data;
const isLoading = useYn ? listByUseYnQuery.isPending : listQuery.isPending;
return (
<Select {...props} disabled={props.disabled || isLoading}>
<SelectTrigger className={cn("w-[12rem]", className)}>
<SelectValue placeholder={isLoading ? "로딩 중…" : placeholder} />
</SelectTrigger>
<SelectContent>
{codes?.map((item) => (
<SelectItem key={item.lwpoCd} value={item.lwpoCd}>
{item.lwpoCdNm}
</SelectItem>
))}
</SelectContent>
</Select>
);
}
export { CodeSelect };