{"version":3,"file":"Unauthorized.cjs","sources":["../../../../src/components/status/Unauthorized.tsx"],"sourcesContent":["import React from \"react\";\n\ninterface UnauthorizedProps {\n  /**\n   * Custom message to display to the user\n   */\n  message?: string;\n  /**\n   * URL to redirect the user to\n   */\n  redirectTo?: string;\n  /**\n   * Text to display for the redirect link\n   */\n  linkText?: string;\n  /**\n   * HTTP error code to display\n   */\n  errorCode?: number;\n}\n\n/**\n * Unauthorized component displays when a user doesn't have permission to access a page\n * @param props Component properties\n * @returns JSX element with unauthorized message and redirect link\n * @example\n * ```tsx\n * <Unauthorized message=\"You are not authorized to access this page\" redirectTo=\"/\" linkText=\"Go back to homepage\" errorCode={403} />\n * ```\n */\nconst Unauthorized: React.FC<UnauthorizedProps> = ({\n  message,\n  redirectTo = \"/\",\n  linkText = \"Go back to homepage\",\n  errorCode = 403,\n}) => {\n  const url =\n    errorCode === 401 ? \"/auth/login\" : errorCode === 403 ? redirectTo : \"/\";\n  const label = errorCode === 401 ? \"Login\" : linkText;\n  return (\n    <div className=\"ihub-container ihub-pt-20\">\n      <div className=\"ihub-max-w-600 ihub-mx-auto ihub-text-center ihub-py-8\">\n        <div className=\"ihub-mb-6\">\n          <div className=\"ihub-error-code ihub-text-center ihub-mb-4\">\n            <span className=\"ihub-text-DarkCyan ihub-fs-5 tw-700\">\n              {errorCode}\n            </span>\n          </div>\n          <h1 className=\"ihub-mb-2 tw-600 ihub-text-center\">Access Denied</h1>\n          <p className=\"ihub-mb-4 ihub-text-center\">\n            {message || errorCode === 401\n              ? \"You are not logged in.\"\n              : \"You don't have permission to access this page.\"}\n          </p>\n          <a href={url} className=\"important-btn ihub-inline-block\">\n            {label}\n          </a>\n        </div>\n      </div>\n    </div>\n  );\n};\n\nexport default Unauthorized;\n"],"names":["_ref","message","_ref$redirectTo","redirectTo","_ref$linkText","linkText","_ref$errorCode","errorCode","url","label","_jsx","className","children","jsx","_jsxs","jsxs","href"],"mappings":"uHA8BkD,SAAhCA,GAKb,IAJHC,EAAOD,EAAPC,QAAOC,EAAAF,EACPG,WAAAA,OAAa,IAAHD,EAAG,IAAGA,EAAAE,EAAAJ,EAChBK,SAAAA,OAAW,IAAHD,EAAG,sBAAqBA,EAAAE,EAAAN,EAChCO,UAAAA,OAAY,IAAHD,EAAG,IAAGA,EAETE,EACU,MAAdD,EAAoB,cAA8B,MAAdA,EAAoBJ,EAAa,IACjEM,EAAsB,MAAdF,EAAoB,QAAUF,EAC5C,OACEK,EAAAA,WAAKC,UAAU,4BACbC,SAAAF,EAAAG,IAAA,MAAA,CAAKF,UAAU,kEACbG,EAAKC,KAAA,MAAA,CAAAJ,UAAU,YAAWC,SAAA,CACxBF,aAAKC,UAAU,6CACbC,SAAAF,EAAAG,IAAA,OAAA,CAAMF,UAAU,+CACbJ,MAGLG,EAAAG,IAAA,KAAA,CAAIF,UAAU,+DACdD,EAAAG,IAAA,IAAA,CAAGF,UAAU,sCACVV,GAAyB,MAAdM,EACR,yBACA,mDAENG,EAAGG,IAAA,IAAA,CAAAG,KAAMR,EAAKG,UAAU,2CACrBF,UAMb"}