feat(rfid): front end view of the readers and there status
This commit is contained in:
28
frontend/src/components/rfid/RfidPage.tsx
Normal file
28
frontend/src/components/rfid/RfidPage.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import { getReaders } from "@/utils/querys/rfid/getReaders";
|
||||
import { readerColumns } from "@/utils/tableData/rfid/readers/readerColumns";
|
||||
import { ReaderTable } from "@/utils/tableData/rfid/readers/readerData";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
|
||||
export default function RfidPage() {
|
||||
const { data, isError, isLoading } = useQuery(getReaders());
|
||||
|
||||
if (isError) {
|
||||
return <div>Error</div>;
|
||||
}
|
||||
|
||||
if (isLoading) {
|
||||
return <div>Loading</div>;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="m-2">
|
||||
<ReaderTable
|
||||
columns={readerColumns}
|
||||
data={data.data.sort((a: any, b: any) =>
|
||||
a.reader.localeCompare(b.reader)
|
||||
)}
|
||||
//style={style}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user