/**
 * Copyright IBM Corp. 2020, 2026
 *
 * This source code is licensed under the Apache-2.0 license found in the
 * LICENSE file in the root directory of this source tree.
 */

import { pkg } from "../../settings.js";
import React from "react";
import { arrayOf, shape, string } from "prop-types";
import { Link } from "@carbon/react";

//#region src/components/HTTPErrors/HTTPErrorContent.jsx
/**
* Copyright IBM Corp. 2021, 2021
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
const blockClass = `${pkg.prefix}--http-errors`;
const componentName = "HTTPErrorContent";
let HTTPErrorContent = ({ description, errorCodeLabel, title, links }) => {
	return /* @__PURE__ */ React.createElement("div", { className: `${blockClass}__content` }, errorCodeLabel && /* @__PURE__ */ React.createElement("p", { className: `${blockClass}__error-code-label` }, errorCodeLabel), title && /* @__PURE__ */ React.createElement("h1", { className: `${blockClass}__title` }, title), description && /* @__PURE__ */ React.createElement("p", { className: `${blockClass}__description` }, description), links && links.length && links.map((link) => /* @__PURE__ */ React.createElement(Link, {
		...link,
		role: "link",
		href: link.href,
		key: link.text,
		className: `${blockClass}__link`
	}, link.text)));
};
HTTPErrorContent.displayName = componentName;
HTTPErrorContent.propTypes = {
	description: string.isRequired,
	errorCodeLabel: string.isRequired,
	links: arrayOf(shape({
		...Link.propTypes,
		text: string.isRequired,
		href: string.isRequired
	})),
	title: string.isRequired
};

//#endregion
export { HTTPErrorContent };