From e29c7163ed2826e1a3668188c001f34a2f2192e2 Mon Sep 17 00:00:00 2001 From: DDD1542 Date: Sat, 7 Mar 2026 03:34:27 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20DataTable=20=EC=BB=B4=ED=8F=AC?= =?UTF-8?q?=EB=84=8C=ED=8A=B8=20=EB=B0=98=EC=9D=91=ED=98=95=20=EA=B0=9C?= =?UTF-8?q?=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 툴바 모바일 세로 스택 레이아웃 전환 - 검색창 w-full sm:w-64 반응형 너비 - 테이블 overflow-x-auto 가로 스크롤 지원 - 페이지네이션 모바일 레이아웃 개선 - 하드코딩 색상(slate-*) → CSS 변수 기반 색상으로 교체 Made-with: Cursor --- frontend/components/common/DataTable.tsx | 39 ++++++++++++------------ 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/frontend/components/common/DataTable.tsx b/frontend/components/common/DataTable.tsx index a1a3f03e..cd7d1a66 100644 --- a/frontend/components/common/DataTable.tsx +++ b/frontend/components/common/DataTable.tsx @@ -65,17 +65,17 @@ export function DataTable({ return (
- {/* 테이블 상단 툴바 */} -
-
+ {/* 테이블 상단 툴바 - 모바일: 세로 스택, sm 이상: 가로 배치 */} +
+
{searchable && (
- + setGlobalFilter(event.target.value)} - className="w-64 pl-8" + className="w-full pl-8 sm:w-64" />
)} @@ -98,15 +98,15 @@ export function DataTable({
- {/* 테이블 */} -
+ {/* 테이블 - 가로 스크롤 지원 */} +
{table.getHeaderGroups().map((headerGroup) => ( {headerGroup.headers.map((header) => { return ( - + {header.isPlaceholder ? null : (
({ onRowClick?.(row.original)} > {row.getVisibleCells().map((cell) => ( @@ -162,16 +162,17 @@ export function DataTable({
- {/* 페이지네이션 */} -
-
+ {/* 페이지네이션 - 모바일: 세로 스택, sm 이상: 가로 배치 */} +
+
{table.getFilteredSelectedRowModel().rows.length}개 중 {table.getFilteredRowModel().rows.length}개 표시
-
+
-

페이지당 행 수

+ {/* 모바일에서 "페이지당 행 수" 텍스트 숨김 */} +

페이지당 행 수

-
- 페이지 {table.getState().pagination.pageIndex + 1} / {table.getPageCount()} -
-
+
+
+ 페이지 {table.getState().pagination.pageIndex + 1} / {table.getPageCount()} +