onsitesurvey/src/components/popup/SuitableDetailPopupButton.tsx

43 lines
1.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use client'
import { useRouter } from 'next/navigation'
import { usePopupController } from '@/store/popupController'
import { useSuitable } from '@/hooks/useSuitable'
export default function SuitableDetailPopupButton() {
const router = useRouter()
const popupController = usePopupController()
const { downloadSuitablePdf } = useSuitable()
const handleClosePopup = () => {
popupController.setSuitableDetailPopup(false)
}
const handleRedirectPage = (path: string) => {
handleClosePopup()
router.push(path)
}
return (
<div className="float-btn-wrap">
<div className="btn-flex-wrap com">
<div className="btn-bx">
<button className="btn-frame n-blue icon" onClick={handleClosePopup}>
<i className="btn-arr"></i>
</button>
</div>
<div className="btn-bx">
<button className="btn-frame red icon" onClick={downloadSuitablePdf}>
<i className="btn-arr"></i>
</button>
</div>
<div className="btn-bx">
<button className="btn-frame n-blue icon" onClick={() => handleRedirectPage('/inquiry/regist')}>
11<i className="btn-arr"></i>
</button>
</div>
</div>
</div>
)
}