diff --git a/src/features/dev/pages/ClinicsPage.tsx b/src/features/dev/pages/ClinicsPage.tsx deleted file mode 100644 index 2402118..0000000 --- a/src/features/dev/pages/ClinicsPage.tsx +++ /dev/null @@ -1,159 +0,0 @@ -/** - * Dev: 클리닉 리스트 페이지. - * - * 백엔드 `GET /api/clinics` (getClinics) 응답을 표로 확인하는 개발용 화면. - * 운영 도메인 노출 방지는 라우트 단의 DevOnly 가드에 위임. - */ -import { useState } from 'react'; -import { Link } from 'react-router'; -import { useGetClinics } from '@/shared/api/generated/clinics/clinics'; -import { PageContainer } from '@/shared/ui/page-container'; -import { Spinner } from '@/shared/ui/spinner'; -import { EmptyState } from '@/shared/ui/empty-state'; -import { Button } from '@/shared/ui/button'; - -const PAGE_SIZE = 50; - -function formatDate(raw: string): string { - try { - return new Date(raw).toLocaleString('ko-KR', { - year: 'numeric', - month: '2-digit', - day: '2-digit', - hour: '2-digit', - minute: '2-digit', - }); - } catch { - return raw; - } -} - -export default function ClinicsPage() { - const [offset, setOffset] = useState(0); - - const { data, isLoading, error, refetch, isFetching } = useGetClinics( - { limit: PAGE_SIZE, offset }, - { query: { staleTime: 0 } }, - ); - - const items = data?.status === 200 ? data.data.items : []; - const total = data?.status === 200 ? data.data.total : 0; - - return ( -
- -
-
-

- Dev · Clinics -

-

- 클리닉 리스트 -

-

- GET /api/clinics · limit={PAGE_SIZE} · offset={offset} · total={total} -

-
-
- -
-
- - {isLoading ? ( -
- -
- ) : error ? ( -
- 클리닉 리스트 조회 실패: {String((error as Error)?.message ?? error)} -
- ) : items.length === 0 ? ( - - ) : ( -
- - - - - - - - - - - - - - {items.map((c) => ( - - - - - - - - - - ))} - -
병원명EN상태URL주소생성일hospital_id
- - {c.hospital_name} - - {c.hospital_name_en ?? '—'} - - {c.status} - - - {c.url ? ( - - {c.url} - - ) : ( - '—' - )} - {c.road_address ?? '—'}{formatDate(c.created_at)}{c.hospital_id}
-
- )} - -
- - {total > 0 ? `${offset + 1}-${Math.min(offset + items.length, total)} / ${total}` : ''} - - - -
-
-
- ); -} diff --git a/src/features/dev/routes.tsx b/src/features/dev/routes.tsx index 34ff8fe..7f5f3dc 100644 --- a/src/features/dev/routes.tsx +++ b/src/features/dev/routes.tsx @@ -2,7 +2,6 @@ import { lazy } from 'react' import DevOnly from './components/DevOnly' const ComponentsPage = lazy(() => import('./pages/ComponentsPage')) -const ClinicsPage = lazy(() => import('./pages/ClinicsPage')) const TestPrefillPage = lazy(() => import('./pages/TestPrefillPage')) // `/dev/*` 와 `/test` 는 DevOnly 가드를 거쳐 로컬호스트에서만 접근 가능. @@ -11,7 +10,6 @@ export const devRoutes = [ element: , children: [ { path: 'dev/components', element: }, - { path: 'dev/clinics', element: }, { path: 'test', element: }, ], },