diff --git a/src/components/home/CurrentOffice.tsx b/src/components/home/CurrentOffice.tsx index 87d5c75..b6fd49d 100644 --- a/src/components/home/CurrentOffice.tsx +++ b/src/components/home/CurrentOffice.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import React, { useState, useEffect } from 'react'; import SearchModal from './SearchModal'; import SelectOfficeMap from './SelectOfficeMap'; import { Branch } from '@/api/types/branch'; @@ -6,18 +6,28 @@ import { useBranchStore } from '@/store/branch.store'; const CurrentOffice = () => { const [showSearchModal, setShowSearchModal] = useState(false); + const [showSelectOfficeMap, setShowSelectOfficeMap] = useState(false); const selectedBranch = useBranchStore((state) => state.selectedBranch); const setSelectedBranch = useBranchStore((state) => state.setSelectedBranch); const handleBranchSelect = (branch: Branch) => { setSelectedBranch(branch); setShowSearchModal(false); + setShowSelectOfficeMap(true); }; const handleSearchClick = () => { setShowSearchModal(true); }; + const handleCloseSelectOfficeMap = () => { + setShowSelectOfficeMap(false); + }; + + useEffect(() => { + console.log('Selected Branch Updated:', selectedBranch); + }, [selectedBranch]); + return ( <>