{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\user\\\\Desktop\\\\00monsite\\\\front\\\\src\\\\page\\\\Destination.js\",\n  _s = $RefreshSig$();\nimport React, { useEffect, useState } from \"react\";\nimport Navbar from \"../components/Navbar\";\nimport axios from \"axios\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nconst Destination = () => {\n  _s();\n  const [currentDestination, setCurrentDestination] = useState({});\n  const [destinations, setDestinations] = useState([]);\n  useEffect(() => {\n    fetch('data.json').then(response => response.json()).then(data => {\n      setDestinations(data.destinations);\n      setCurrentDestination(data.destinations[0]);\n    });\n  }, []);\n  function select(text) {\n    //   const selectedDestination = destinations.find(destination => destination.name === text.innerHTML);\n    //   setCurrentDestination(selectedDestination);\n    const navLinks = document.querySelectorAll('.destination__content--text_select p');\n    navLinks.forEach(select => text.classList.remove('nav-text--active'));\n    e.target.classList.add('nav-text--active');\n    content();\n  }\n  function content() {\n    const {\n      images,\n      name,\n      description,\n      distance,\n      travel\n    } = currentDestination;\n    const picture = document.getElementById('picture');\n    const nameElement = document.getElementById('name');\n    const desc = document.getElementById('desc');\n    const distanceElement = document.getElementById('distance');\n    const travelElement = document.getElementById('travel');\n    picture.src = images.webp;\n    nameElement.innerHTML = name;\n    desc.innerHTML = description;\n    distanceElement.innerHTML = distance;\n    travelElement.innerHTML = travel;\n  }\n  return /*#__PURE__*/_jsxDEV(\"div\", {\n    className: \"bg-destination\",\n    children: [/*#__PURE__*/_jsxDEV(Navbar, {}, void 0, false, {\n      fileName: _jsxFileName,\n      lineNumber: 46,\n      columnNumber: 7\n    }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n      className: \"destination__content--text border row\",\n      id: \"row\",\n      children: [/*#__PURE__*/_jsxDEV(\"div\", {\n        className: \"container-planet\",\n        children: [/*#__PURE__*/_jsxDEV(\"div\", {\n          children: /*#__PURE__*/_jsxDEV(\"h5\", {\n            children: \"01 PICK YOUR DESTINATION\"\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 50,\n            columnNumber: 13\n          }, this)\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 49,\n          columnNumber: 11\n        }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n          children: /*#__PURE__*/_jsxDEV(\"img\", {\n            id: \"picture\",\n            className: \"destination__content--planet\",\n            src: \"./images/destination/image-moon.png\",\n            alt: \"\"\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 53,\n            columnNumber: 13\n          }, this)\n        }, void 0, false, {\n          fileName: _jsxFileName,\n          lineNumber: 52,\n          columnNumber: 11\n        }, this)]\n      }, void 0, true, {\n        fileName: _jsxFileName,\n        lineNumber: 48,\n        columnNumber: 9\n      }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n        className: \"container-plane\",\n        children: [/*#__PURE__*/_jsxDEV(\"nav\", {\n          className: \"navbar \",\n          children: [/*#__PURE__*/_jsxDEV(\"h6\", {\n            className: \"nav-link nav-text nav-text--active\",\n            onClick: e => select(e.target),\n            children: \"Moon\"\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 63,\n            columnNumber: 13\n          }, this), /*#__PURE__*/_jsxDEV(\"h6\", {\n            className: \"nav-link nav-text destination__select\",\n            onClick: e => select(e.target),\n            children: \"Mars\"\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 69,\n            columnNumber: 13\n          }, this), /*#__PURE__*/_jsxDEV(\"h6\", {\n            className: \"nav-link nav-text destination__select\",\n            onClick: e => select(e.target),\n            children: \"Europa\"\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 75,\n            columnNumber: 13\n          }, this), /*#__PURE__*/_jsxDEV(\"h6\", {\n            className: \"nav-link nav-text destination__select\",\n            onClick: e => select(e.target),\n            children: \"Titan\"\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 81,\n            columnNumber: 13\n          }, this)]\n        }, void 0, true, {\n          fileName: _jsxFileName,\n          lineNumber: 62,\n          columnNumber: 11\n        }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n          className: \"tex_destination\",\n          children: [/*#__PURE__*/_jsxDEV(\"div\", {\n            id: \"name\"\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 90,\n            columnNumber: 13\n          }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n            children: /*#__PURE__*/_jsxDEV(\"p\", {\n              id: \"description\",\n              children: \"See our planet as you\\u2019ve never seen it before. A perfect relaxing trip away to help regain perspective and come back refreshed. While you\\u2019re there, take in some history by visiting the Luna 2 and Apollo 11 landing sites.\"\n            }, void 0, false, {\n              fileName: _jsxFileName,\n              lineNumber: 92,\n              columnNumber: 15\n            }, this)\n          }, void 0, false, {\n            fileName: _jsxFileName,\n            lineNumber: 91,\n            columnNumber: 13\n          }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n            children: [/*#__PURE__*/_jsxDEV(\"div\", {\n              id: \"distance\",\n              children: \"384.400. km\"\n            }, void 0, false, {\n              fileName: _jsxFileName,\n              lineNumber: 100,\n              columnNumber: 15\n            }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n              id: \"travel\",\n              children: \"3 days\"\n            }, void 0, false, {\n              fileName: _jsxFileName,\n              lineNumber: 101,\n              columnNumber: 15\n            }, this)]\n          }, void 0, true, {\n            fileName: _jsxFileName,\n            lineNumber: 99,\n            columnNumber: 13\n          }, this)]\n        }, void 0, true, {\n          fileName: _jsxFileName,\n          lineNumber: 89,\n          columnNumber: 11\n        }, this)]\n      }, void 0, true, {\n        fileName: _jsxFileName,\n        lineNumber: 61,\n        columnNumber: 9\n      }, this)]\n    }, void 0, true, {\n      fileName: _jsxFileName,\n      lineNumber: 47,\n      columnNumber: 7\n    }, this)]\n  }, void 0, true, {\n    fileName: _jsxFileName,\n    lineNumber: 45,\n    columnNumber: 5\n  }, this);\n};\n_s(Destination, \"ghJuS575yz1gNYwF0Umt6GINJHM=\");\n_c = Destination;\nexport default Destination;\nvar _c;\n$RefreshReg$(_c, \"Destination\");","map":{"version":3,"names":["React","useEffect","useState","Navbar","axios","Destination","currentDestination","setCurrentDestination","destinations","setDestinations","fetch","then","response","json","data","select","text","navLinks","document","querySelectorAll","forEach","classList","remove","e","target","add","content","images","name","description","distance","travel","picture","getElementById","nameElement","desc","distanceElement","travelElement","src","webp","innerHTML"],"sources":["C:/Users/user/Desktop/00monsite/front/src/page/Destination.js"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\r\nimport Navbar from \"../components/Navbar\";\r\nimport axios from \"axios\";\r\n\r\nconst Destination = () => {\r\n    const [currentDestination, setCurrentDestination] = useState({});\r\n    const [destinations, setDestinations] = useState([]);\r\n  \r\n    useEffect(() => {\r\n      fetch('data.json')\r\n        .then(response => response.json())\r\n        .then(data => {\r\n          setDestinations(data.destinations);\r\n          setCurrentDestination(data.destinations[0]);\r\n        });\r\n    }, []);\r\n  \r\n    function select(text) {\r\n    //   const selectedDestination = destinations.find(destination => destination.name === text.innerHTML);\r\n    //   setCurrentDestination(selectedDestination);\r\n      const navLinks = document.querySelectorAll('.destination__content--text_select p');\r\n      navLinks.forEach(select => text.classList.remove('nav-text--active'));\r\n      e.target.classList.add('nav-text--active');\r\n      \r\n  \r\n      content();\r\n    }\r\n  \r\n    function content() {\r\n      const { images, name, description, distance, travel } = currentDestination;\r\n      const picture = document.getElementById('picture');\r\n      const nameElement = document.getElementById('name');\r\n      const desc = document.getElementById('desc');\r\n      const distanceElement = document.getElementById('distance');\r\n      const travelElement = document.getElementById('travel');\r\n  \r\n      picture.src = images.webp;\r\n      nameElement.innerHTML = name;\r\n      desc.innerHTML = description;\r\n      distanceElement.innerHTML = distance;\r\n      travelElement.innerHTML = travel;\r\n    }\r\n  \r\n  return (\r\n    <div className=\"bg-destination\">\r\n      <Navbar />\r\n      <div className=\"destination__content--text border row\" id=\"row\">\r\n        <div className=\"container-planet\">\r\n          <div>\r\n            <h5>01 PICK YOUR DESTINATION</h5>\r\n          </div>\r\n          <div>\r\n            <img\r\n              id=\"picture\"\r\n              className=\"destination__content--planet\"\r\n              src=\"./images/destination/image-moon.png\"\r\n              alt=\"\"\r\n            />\r\n          </div>\r\n        </div>\r\n        <div className=\"container-plane\">\r\n          <nav className=\"navbar \">\r\n            <h6\r\n              className=\"nav-link nav-text nav-text--active\"\r\n              onClick={(e) => select(e.target)}\r\n            >\r\n              Moon\r\n            </h6>\r\n            <h6\r\n              className=\"nav-link nav-text destination__select\"\r\n              onClick={(e) => select(e.target)}\r\n            >\r\n              Mars\r\n            </h6>\r\n            <h6\r\n              className=\"nav-link nav-text destination__select\"\r\n              onClick={(e) => select(e.target)}\r\n            >\r\n              Europa\r\n            </h6>\r\n            <h6\r\n              className=\"nav-link nav-text destination__select\"\r\n              onClick={(e) => select(e.target)}\r\n            >\r\n              Titan\r\n            </h6>\r\n          </nav>\r\n\r\n          <div className=\"tex_destination\">\r\n            <div id=\"name\"></div>\r\n            <div>\r\n              <p id=\"description\">\r\n                See our planet as you’ve never seen it before. A perfect\r\n                relaxing trip away to help regain perspective and come back\r\n                refreshed. While you’re there, take in some history by visiting\r\n                the Luna 2 and Apollo 11 landing sites.\r\n              </p>\r\n            </div>\r\n            <div>\r\n              <div id=\"distance\">384.400. km</div>\r\n              <div id=\"travel\">3 days</div>\r\n            </div>\r\n            {/* <div>{content()}</div> */}\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </div>\r\n  );\r\n};\r\nexport default Destination;\r\n"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,OAAOC,MAAM,MAAM,sBAAsB;AACzC,OAAOC,KAAK,MAAM,OAAO;AAAC;AAE1B,MAAMC,WAAW,GAAG,MAAM;EAAA;EACtB,MAAM,CAACC,kBAAkB,EAAEC,qBAAqB,CAAC,GAAGL,QAAQ,CAAC,CAAC,CAAC,CAAC;EAChE,MAAM,CAACM,YAAY,EAAEC,eAAe,CAAC,GAAGP,QAAQ,CAAC,EAAE,CA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