diff --git a/public/map/FocusZone.svg b/public/map/FocusZone.svg new file mode 100644 index 0000000..8e9ff2e --- /dev/null +++ b/public/map/FocusZone.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/public/map/FocusZoneInactive.svg b/public/map/FocusZoneInactive.svg new file mode 100644 index 0000000..70c5a7e --- /dev/null +++ b/public/map/FocusZoneInactive.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/map/MeetingRoom.svg b/public/map/MeetingRoom.svg new file mode 100644 index 0000000..4a60559 --- /dev/null +++ b/public/map/MeetingRoom.svg @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/map/MeetingRoomInactive.svg b/public/map/MeetingRoomInactive.svg new file mode 100644 index 0000000..ec6b2ff --- /dev/null +++ b/public/map/MeetingRoomInactive.svg @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/map/Recharge.svg b/public/map/Recharge.svg new file mode 100644 index 0000000..52af81b --- /dev/null +++ b/public/map/Recharge.svg @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/map/RechargeInactive.svg b/public/map/RechargeInactive.svg new file mode 100644 index 0000000..357ef85 --- /dev/null +++ b/public/map/RechargeInactive.svg @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/reservation/CantInviteUser.svg b/public/reservation/CantInviteUser.svg new file mode 100644 index 0000000..ef0b04e --- /dev/null +++ b/public/reservation/CantInviteUser.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/public/reservation/ExclamationMark.svg b/public/reservation/ExclamationMark.svg new file mode 100644 index 0000000..35d7840 --- /dev/null +++ b/public/reservation/ExclamationMark.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/public/reservation/InvitedUser.svg b/public/reservation/InvitedUser.svg new file mode 100644 index 0000000..4da8df0 --- /dev/null +++ b/public/reservation/InvitedUser.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/public/reservation/bottomArrow.svg b/public/reservation/bottomArrow.svg new file mode 100644 index 0000000..90c765a --- /dev/null +++ b/public/reservation/bottomArrow.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/public/reservation/deleteBtn.svg b/public/reservation/deleteBtn.svg new file mode 100644 index 0000000..c2391e4 --- /dev/null +++ b/public/reservation/deleteBtn.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/public/reservation/inviteUser.svg b/public/reservation/inviteUser.svg new file mode 100644 index 0000000..5e472d7 --- /dev/null +++ b/public/reservation/inviteUser.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/public/reservation/topArrow.svg b/public/reservation/topArrow.svg new file mode 100644 index 0000000..c0dee62 --- /dev/null +++ b/public/reservation/topArrow.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/api/map/getAvailableOffice.ts b/src/api/map/getAvailableOffice.ts new file mode 100644 index 0000000..b4d9818 --- /dev/null +++ b/src/api/map/getAvailableOffice.ts @@ -0,0 +1,25 @@ +// getAvailableOffice.ts +import { OfficeRoomCounts } from '@/api/types/branch'; + +export const getOfficeMeetingRoomCount = async (branchId: number): Promise<{ data: OfficeRoomCounts }> => { + try { + const backendUrl = process.env.NEXT_PUBLIC_BASE_URL; + const token = document.cookie.replace(/(?:(?:^|.*;\s*)token\s*=\s*([^;]*).*$)|^.*$/, "$1"); + const response = await fetch(`${backendUrl}spaces/${branchId}/count`, { + method: 'GET', + headers: { + 'Authorization': `Bearer ${token}`, + 'Content-Type': 'application/json' + }, + cache: 'no-store' + }); + if (!response.ok) { + throw new Error('Failed to fetch meeting room count'); + } + const data: { data: OfficeRoomCounts } = await response.json(); + return data; + } catch (error) { + console.error('Error fetching meeting room count:', error); + throw error; + } +}; diff --git a/src/api/types/branch.ts b/src/api/types/branch.ts index 292526d..a909375 100644 --- a/src/api/types/branch.ts +++ b/src/api/types/branch.ts @@ -35,6 +35,7 @@ export interface OfficeInfoProps { } export interface SelectedBranch { + branchId: number; branchName: string; branchAddress: string; branchLatitude: number; @@ -51,3 +52,12 @@ export interface BranchAvailable { branchTotalMeetingRoomCount: number; branchActiveMeetingRoomCount: number; } + +export interface OfficeRoomCounts { + focusDeskCount: number; + mediumRoomCount: number; + miniRoomCount: number; + rechargingRoomCount: number; + standardRoomCount: number; + stateRoomCount: number; +} \ No newline at end of file diff --git a/src/api/types/reserve.ts b/src/api/types/reserve.ts index 15f5c4b..ea290ef 100644 --- a/src/api/types/reserve.ts +++ b/src/api/types/reserve.ts @@ -3,7 +3,7 @@ export interface Reserve { meetingRoomId: number; startAt: string; endAt: string; - memberIds: number[]; + memberIds: string[]; } export interface ReservationModalProps { diff --git a/src/components/home/SelectOfficeMap.tsx b/src/components/home/SelectOfficeMap.tsx index 0d64a54..38b5911 100644 --- a/src/components/home/SelectOfficeMap.tsx +++ b/src/components/home/SelectOfficeMap.tsx @@ -70,7 +70,7 @@ const SelectOfficeMap: React.FC = ({ branch, onClose }) =>
-