{"ast":null,"code":"import _regenerator from\"C:/ldt/LDT/management/node_modules/@babel/runtime/helpers/esm/regenerator.js\";import _asyncToGenerator from\"C:/ldt/LDT/management/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";import React from\"react\";import{Box,AlertDialog,AlertDialogBody,AlertDialogFooter,AlertDialogHeader,AlertDialogContent,AlertDialogOverlay,AlertDialogCloseButton,Button}from\"@chakra-ui/react\";import{NavLink,useNavigate}from\"react-router-dom\";import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";function LogoutPopUp(_ref){var isOpen=_ref.isOpen,onClose=_ref.onClose;var cancelRef=React.useRef();var navigate=useNavigate();var handleLogout=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(){return _regenerator().w(function(_context){while(1)switch(_context.n){case 0:localStorage.removeItem(\"accessToken\");onClose===null||onClose===void 0?void 0:onClose();navigate(\"/auth/signin\",{replace:true});case 1:return _context.a(2);}},_callee);}));return function handleLogout(){return _ref2.apply(this,arguments);};}();return/*#__PURE__*/_jsxs(AlertDialog,{isOpen:isOpen,leastDestructiveRef:cancelRef,onClose:onClose,isCentered:true,motionPreset:\"slideInBottom\",children:[/*#__PURE__*/_jsx(AlertDialogOverlay,{}),/*#__PURE__*/_jsxs(AlertDialogContent,{borderRadius:\"20px\",marginX:\"20px\",children:[/*#__PURE__*/_jsx(AlertDialogHeader,{textColor:\"text.900\",mt:\"36px\",align:\"center\",children:\"\\uB85C\\uADF8\\uC544\\uC6C3 \\uD558\\uC2DC\\uACA0\\uC2B5\\uB2C8\\uAE4C?\"}),/*#__PURE__*/_jsx(AlertDialogCloseButton,{top:\"12px\",right:\"12px\",color:\"text.300\",sx:{_focus:{boxShadow:\"none\",outline:\"none\",bg:\"transparent\"}}}),/*#__PURE__*/_jsx(AlertDialogFooter,{p:\"0\",m:\"0\",children:/*#__PURE__*/_jsxs(Box,{display:\"flex\",width:\"100%\",mt:\"48px\",children:[/*#__PURE__*/_jsx(Button,{ref:cancelRef,onClick:onClose,flex:\"0.8\",p:\"28px\",borderRadius:\"0\",borderBottomLeftRadius:\"20px\",bg:\"textbox\",color:\"text.700\",fontSize:\"lg\",fontWeight:\"700\",_hover:{bg:\"gray.200\"},children:\"\\uCDE8\\uC18C\"}),/*#__PURE__*/_jsx(Button,{onClick:handleLogout,flex:\"1\",p:\"28px\",borderRadius:\"0\",borderBottomRightRadius:\"20px\",bg:\"main.900\",color:\"white\",fontSize:\"lg\",fontWeight:\"700\",_hover:{bg:\"main.900\"},children:\"\\uB85C\\uADF8\\uC544\\uC6C3\"})]})})]})]});}export default LogoutPopUp;","map":{"version":3,"names":["React","Box","AlertDialog","AlertDialogBody","AlertDialogFooter","AlertDialogHeader","AlertDialogContent","AlertDialogOverlay","AlertDialogCloseButton","Button","NavLink","useNavigate","jsx","_jsx","jsxs","_jsxs","LogoutPopUp","_ref","isOpen","onClose","cancelRef","useRef","navigate","handleLogout","_ref2","_asyncToGenerator","_regenerator","m","_callee","w","_context","n","localStorage","removeItem","replace","a","apply","arguments","leastDestructiveRef","isCentered","motionPreset","children","borderRadius","marginX","textColor","mt","align","top","right","color","sx","_focus","boxShadow","outline","bg","p","display","width","ref","onClick","flex","borderBottomLeftRadius","fontSize","fontWeight","_hover","borderBottomRightRadius"],"sources":["C:/ldt/LDT/management/src/components/PopUp/LogoutPopUp.js"],"sourcesContent":["import React from \"react\";\r\nimport {\r\n  Box,\r\n  AlertDialog,\r\n  AlertDialogBody,\r\n  AlertDialogFooter,\r\n  AlertDialogHeader,\r\n  AlertDialogContent,\r\n  AlertDialogOverlay,\r\n  AlertDialogCloseButton,\r\n  Button,\r\n} from \"@chakra-ui/react\";\r\n\r\nimport { NavLink, useNavigate } from \"react-router-dom\";\r\n\r\n\r\nfunction LogoutPopUp({\r\n  isOpen,\r\n  onClose,\r\n}) {\r\n  const cancelRef = React.useRef();\r\n  const navigate = useNavigate();\r\n\r\n  const handleLogout = async () => {\r\n    localStorage.removeItem(\"accessToken\");\r\n\r\n    onClose?.();\r\n\r\n    navigate(\"/auth/signin\", { replace: true });\r\n  };\r\n\r\n  return (\r\n    <AlertDialog\r\n      isOpen={isOpen}\r\n      leastDestructiveRef={cancelRef}\r\n      onClose={onClose}\r\n      isCentered\r\n      motionPreset=\"slideInBottom\"\r\n    >\r\n      <AlertDialogOverlay />\r\n      <AlertDialogContent\r\n        borderRadius=\"20px\"\r\n        marginX=\"20px\"\r\n      >\r\n        <AlertDialogHeader textColor=\"text.900\" mt=\"36px\" align=\"center\">로그아웃 하시겠습니까?</AlertDialogHeader>\r\n        <AlertDialogCloseButton\r\n          top=\"12px\"\r\n          right=\"12px\"\r\n          color=\"text.300\"\r\n          sx={{\r\n            _focus: {\r\n              boxShadow: \"none\",\r\n              outline: \"none\",\r\n              bg: \"transparent\",\r\n            },\r\n          }}\r\n        />\r\n        <AlertDialogFooter p=\"0\" m=\"0\">\r\n          <Box display=\"flex\" width=\"100%\" mt=\"48px\">\r\n            <Button\r\n              ref={cancelRef}\r\n              onClick={onClose}\r\n              flex=\"0.8\"\r\n              p=\"28px\"\r\n              borderRadius=\"0\"\r\n              borderBottomLeftRadius=\"20px\"\r\n              bg=\"textbox\" \r\n              color=\"text.700\"\r\n              fontSize=\"lg\"\r\n              fontWeight=\"700\"\r\n              _hover={{ bg: \"gray.200\" }}\r\n            >\r\n              취소\r\n            </Button>\r\n\r\n            <Button\r\n              onClick={handleLogout}\r\n              flex=\"1\"\r\n              p=\"28px\"\r\n              borderRadius=\"0\"\r\n              borderBottomRightRadius=\"20px\"\r\n              bg=\"main.900\"\r\n              color=\"white\"\r\n              fontSize=\"lg\"\r\n              fontWeight=\"700\"\r\n              _hover={{ bg: \"main.900\" }}\r\n            >\r\n              로그아웃\r\n            </Button>\r\n          </Box>\r\n        </AlertDialogFooter>\r\n      </AlertDialogContent>\r\n    </AlertDialog>\r\n  );\r\n}\r\n\r\nexport default LogoutPopUp;\r\n"],"mappings":"wNAAA,MAAO,CAAAA,K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