'use client'; import Guard from '@/components/guard'; import { Button } from '@/components/ui/button'; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from '@/components/ui/table'; import { useGroupSensors } from '@/hooks/useGroupSensor'; import Link from 'next/link'; import { useParams, useRouter } from 'next/navigation'; export default function GroupSensorsPage() { const params = useParams(); const groupId = Number(params.groupId); const router = useRouter(); const { data, isLoading, isError, refetch } = useGroupSensors(groupId); return (

센서 그룹

{isLoading &&

불러오는 중...

} {isError &&

불러오지 못했습니다.

} {!isLoading && !isError && (
ID 이름 단위 데이터 {data && data.length > 0 ? ( data.map((s) => ( {s.id} {s.name} {s.unit ?? '-'} )) ) : ( 데이터가 없습니다. )}
)}
); }