diff --git a/packages/admin/src/features/QR-code-scanner/ui/QRCodeScannerPage.tsx b/packages/admin/src/features/QR-code-scanner/ui/QRCodeScannerPage.tsx index c6315f7..0ed3a75 100644 --- a/packages/admin/src/features/QR-code-scanner/ui/QRCodeScannerPage.tsx +++ b/packages/admin/src/features/QR-code-scanner/ui/QRCodeScannerPage.tsx @@ -19,10 +19,8 @@ export const QRCodeScannerPage = () => { alert("QR Code가 정상적으로 스캔되었습니다."); try { - // JSON 파싱 const parsedData = JSON.parse(result.text); - // studentId 추출 const studentId = parsedData.studentId; setScannedStudentId(studentId); } catch (error) { @@ -33,9 +31,6 @@ export const QRCodeScannerPage = () => { } }; - console.log(scannedData); - console.log(typeof scannedStudentId); - return (
- 이름 - | -- 학번 - | -- 전화번호 - | -- 팀 이름 - | -- 전공 - | -- 승인 - | -- 체크인/아웃 - | + {TABLE_HEADERS.map((header) => ( ++ {header.label} + | + ))}{person.teamName} | {person.major} |
-
+ |
+
+ |
-
+ |
))}
diff --git a/packages/admin/src/features/people-management/components/features/StatusButton.tsx b/packages/admin/src/features/people-management/components/features/StatusButton.tsx
new file mode 100644
index 0000000..efda4e0
--- /dev/null
+++ b/packages/admin/src/features/people-management/components/features/StatusButton.tsx
@@ -0,0 +1,27 @@
+import { ChevronDown } from "lucide-react";
+
+import { usePutDepositCheck } from "../../api";
+
+type Props = {
+ accepted: boolean;
+ id: number;
+};
+
+export const StatusButton = ({ accepted, id }: Props) => {
+ const { mutate: updatePersonStatus } = usePutDepositCheck(id);
+ const handleChangeStatus = () => {
+ updatePersonStatus();
+ };
+
+ return (
+
+ );
+};
diff --git a/packages/admin/src/features/people-management/components/features/index.ts b/packages/admin/src/features/people-management/components/features/index.ts
index c403bc2..eea56fe 100644
--- a/packages/admin/src/features/people-management/components/features/index.ts
+++ b/packages/admin/src/features/people-management/components/features/index.ts
@@ -1,2 +1,5 @@
export { InputField } from "./InputField";
export { PeopleTable } from "./PeopleTable";
+export { StatusButton } from "./StatusButton";
+export { CheckInStatus } from "./CheckInStatus";
+export { DeleteButton } from "./DeleteButton";
diff --git a/packages/admin/src/features/people-management/data/index.ts b/packages/admin/src/features/people-management/data/index.ts
new file mode 100644
index 0000000..6e88f02
--- /dev/null
+++ b/packages/admin/src/features/people-management/data/index.ts
@@ -0,0 +1 @@
+export * from "./table-header";
diff --git a/packages/admin/src/features/people-management/data/table-header/TableHeader.ts b/packages/admin/src/features/people-management/data/table-header/TableHeader.ts
new file mode 100644
index 0000000..d214122
--- /dev/null
+++ b/packages/admin/src/features/people-management/data/table-header/TableHeader.ts
@@ -0,0 +1,10 @@
+export const TABLE_HEADERS = [
+ { label: "이름", key: "name" },
+ { label: "학번", key: "studentId" },
+ { label: "전화번호", key: "phoneNumber" },
+ { label: "팀 이름", key: "teamName" },
+ { label: "전공", key: "major" },
+ { label: "입금 확인", key: "accepted" },
+ { label: "체크인 상태", key: "checkined" },
+ { label: "삭제", key: "delete" },
+];
diff --git a/packages/admin/src/features/people-management/data/table-header/index.ts b/packages/admin/src/features/people-management/data/table-header/index.ts
new file mode 100644
index 0000000..3b89d0d
--- /dev/null
+++ b/packages/admin/src/features/people-management/data/table-header/index.ts
@@ -0,0 +1 @@
+export { TABLE_HEADERS } from "./TableHeader";
diff --git a/packages/admin/src/features/people-management/hook/index.ts b/packages/admin/src/features/people-management/hook/index.ts
index 34704a9..c29c4f9 100644
--- a/packages/admin/src/features/people-management/hook/index.ts
+++ b/packages/admin/src/features/people-management/hook/index.ts
@@ -1,2 +1 @@
export { useFilteredPeople } from "./useFilteredPeople";
-export { useUpdatePersonStatus } from "./useUpdatePersonStatus";
diff --git a/packages/admin/src/features/people-management/hook/useUpdatePersonStatus.ts b/packages/admin/src/features/people-management/hook/useUpdatePersonStatus.ts
deleted file mode 100644
index b33334e..0000000
--- a/packages/admin/src/features/people-management/hook/useUpdatePersonStatus.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import { ApplyPeople } from "../api";
-
-export const useUpdatePersonStatus = (people: ApplyPeople[], setPeople: (people: ApplyPeople[]) => void) => {
- const updatePersonStatus = (id: number, status: "accepted" | "rejected" | "checkedIn" | "checkedOut") => {
- setPeople(
- people.map((person) => {
- if (person.id === id) {
- switch (status) {
- case "accepted":
- return { ...person, accepted: true };
- case "rejected":
- return { ...person, accepted: false };
- case "checkedIn":
- return { ...person, checkedIn: true };
- case "checkedOut":
- return { ...person, checkedIn: false };
- default:
- return person;
- }
- }
- return person;
- }),
- );
- };
-
- return updatePersonStatus;
-};
diff --git a/packages/admin/src/features/people-management/index.ts b/packages/admin/src/features/people-management/index.ts
index 56a314f..a5ecb08 100644
--- a/packages/admin/src/features/people-management/index.ts
+++ b/packages/admin/src/features/people-management/index.ts
@@ -1,4 +1,5 @@
export * from "./api";
+export * from "./data";
export * from "./hook";
export * from "./components";
export * from "./ui";
---|