1import{c as m,u as x,r as n,j as e}from"./index-BVWG9e6d.js";import{L as g}from"./loader-2-BaQHybQA.js";/** 2 * @license lucide-react v0.344.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const d=m("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),j=()=>{const{connectSearchConsole:u,userProfile:s}=x(),[c,o]=n.useState(!1),[a,r]=n.useState(null),[l,i]=n.useState(null),h=async()=>{o(!0),r(null),i(null);try{await u(),i("Successfully re-authenticated with Google and updated Search Console connection.")}catch(t){console.error("Error re-authenticating with Google:",t),r(t instanceof Error?t.message:"An unknown error occurred during re-authentication.")}finally{o(!1)}};return e.jsxs("div",{className:"container mx-auto px-4 py-8",children:[e.jsx("h1",{className:"text-3xl font-bold mb-6",children:"Settings"}),e.jsxs("div",{className:"bg-white rounded-lg shadow p-6",children:[e.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Google Account"}),s!=null&&s.searchConsoleConnected?e.jsx("p",{className:"text-gray-600 mb-4",children:"Your Google Search Console account is connected."}):e.jsx("p",{className:"text-gray-600 mb-4",children:"Your Google Search Console account is not connected."}),a&&e.jsxs("div",{className:"bg-red-50 text-red-700 p-3 rounded-md mb-4 flex items-center",children:[e.jsx(d,{className:"w-5 h-5 mr-2"}),e.jsx("p",{children:a})]}),l&&e.jsxs("div",{className:"bg-green-50 text-green-700 p-3 rounded-md mb-4 flex items-center",children:[e.jsx(d,{className:"w-5 h-5 mr-2"})," ",e.jsx("p",{children:l})]}),e.jsx("button",{onClick:h,disabled:c,className:"btn-primary py-2 px-4 rounded-md flex items-center justify-center disabled:opacity-50",children:c?e.jsxs(e.Fragment,{children:[e.jsx(g,{className:"w-5 h-5 mr-2 animate-spin"}),"Connecting..."]}):s!=null&&s.searchConsoleConnected?"Re-authorize Google Account":"Connect Google Account"}),e.jsx("p",{className:"text-sm text-gray-500 mt-3",children:"If you encounter issues with Google Search Console access, or if you need to switch accounts, use this option to re-authenticate."})]})]})};export{j as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.