summaryrefslogtreecommitdiff
path: root/lib/swp/table/swp-table-toolbar.tsx
diff options
context:
space:
mode:
authorjoonhoekim <26rote@gmail.com>2025-10-24 15:18:36 +0900
committerjoonhoekim <26rote@gmail.com>2025-10-24 15:18:36 +0900
commit3e85fbde628bb556e5f6a93cafd9ba4d53031461 (patch)
tree165726e29fe8a11a437dea06217ec4b202219e23 /lib/swp/table/swp-table-toolbar.tsx
parent912e2bc761d7d57bd33d68cb5050da43dea59636 (diff)
(김준회) fix: SWP 초기 개발건 오류 수정
Diffstat (limited to 'lib/swp/table/swp-table-toolbar.tsx')
-rw-r--r--lib/swp/table/swp-table-toolbar.tsx36
1 files changed, 16 insertions, 20 deletions
diff --git a/lib/swp/table/swp-table-toolbar.tsx b/lib/swp/table/swp-table-toolbar.tsx
index 656dfd4a..7c5f2f2e 100644
--- a/lib/swp/table/swp-table-toolbar.tsx
+++ b/lib/swp/table/swp-table-toolbar.tsx
@@ -26,14 +26,12 @@ interface SwpTableToolbarProps {
filters: SwpTableFilters;
onFiltersChange: (filters: SwpTableFilters) => void;
projects?: Array<{ PROJ_NO: string; PROJ_NM: string }>;
- mode?: "admin" | "vendor"; // admin: SWP 동기화 가능, vendor: 읽기 전용
}
export function SwpTableToolbar({
filters,
onFiltersChange,
projects = [],
- mode = "admin",
}: SwpTableToolbarProps) {
const [isSyncing, startSync] = useTransition();
const [localFilters, setLocalFilters] = useState<SwpTableFilters>(filters);
@@ -115,16 +113,14 @@ export function SwpTableToolbar({
{/* 상단 액션 바 */}
<div className="flex items-center justify-between">
<div className="flex items-center gap-2">
- {mode === "admin" && (
- <Button
- onClick={handleSync}
- disabled={isSyncing || !localFilters.projNo}
- size="sm"
- >
- <RefreshCw className={`h-4 w-4 mr-2 ${isSyncing ? "animate-spin" : ""}`} />
- {isSyncing ? "동기화 중..." : "SWP 동기화"}
- </Button>
- )}
+ <Button
+ onClick={handleSync}
+ disabled={isSyncing || !localFilters.projNo}
+ size="sm"
+ >
+ <RefreshCw className={`h-4 w-4 mr-2 ${isSyncing ? "animate-spin" : ""}`} />
+ {isSyncing ? "동기화 중..." : "SWP 동기화"}
+ </Button>
<Button variant="outline" size="sm" disabled>
<Download className="h-4 w-4 mr-2" />
@@ -133,7 +129,7 @@ export function SwpTableToolbar({
</div>
<div className="text-sm text-muted-foreground">
- {mode === "vendor" ? "문서 조회 및 업로드" : "SWP 문서 관리 시스템"}
+ SWP 문서 관리 시스템
</div>
</div>
@@ -166,10 +162,11 @@ export function SwpTableToolbar({
className="w-full justify-between"
>
{localFilters.projNo ? (
- <span className="truncate">
+ <span>
{projects.find((p) => p.PROJ_NO === localFilters.projNo)?.PROJ_NO || localFilters.projNo}
- {" - "}
+ {" ["}
{projects.find((p) => p.PROJ_NO === localFilters.projNo)?.PROJ_NM}
+ {"]"}
</span>
) : (
<span className="text-muted-foreground">프로젝트 선택</span>
@@ -225,10 +222,7 @@ export function SwpTableToolbar({
localFilters.projNo === proj.PROJ_NO ? "opacity-100" : "opacity-0"
)}
/>
- <div className="flex flex-col items-start">
- <span className="font-mono text-sm">{proj.PROJ_NO}</span>
- <span className="text-xs text-muted-foreground">{proj.PROJ_NM}</span>
- </div>
+ <span className="font-mono text-sm">{proj.PROJ_NO} [{proj.PROJ_NM}]</span>
</Button>
))}
{filteredProjects.length === 0 && (
@@ -243,11 +237,13 @@ export function SwpTableToolbar({
) : (
<Input
id="projNo"
- placeholder="예: SN2190"
+ placeholder="계약된 프로젝트가 없습니다"
value={localFilters.projNo || ""}
onChange={(e) =>
setLocalFilters({ ...localFilters, projNo: e.target.value })
}
+ disabled
+ className="bg-muted"
/>
)}
</div>