/**
 * 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.
 */

const require_runtime = require('../../_virtual/_rolldown/runtime.js');
const require_index = require('../../node_modules/classnames/index.js');
const require_settings = require('../../settings.js');
let react = require("react");
react = require_runtime.__toESM(react);
let prop_types = require("prop-types");
prop_types = require_runtime.__toESM(prop_types);
let _carbon_react = require("@carbon/react");
let _carbon_react_icons = require("@carbon/react/icons");

//#region src/components/Card/CardFooter.tsx
var import_classnames = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
const componentName = "CardFooter";
const defaults = {
	actions: Object.freeze([]),
	primaryButtonKind: "primary",
	productive: false,
	secondaryButtonKind: "secondary"
};
const CardFooter = ({ actions = defaults.actions, disabled, footerActionIcon: FooterActionIcon, hasActions, hasButton, onPrimaryButtonClick, onSecondaryButtonClick, primaryButtonDisabled, primaryButtonHref, primaryButtonIcon, primaryButtonKind = "primary", primaryButtonPlacement, primaryButtonText, productive = defaults.productive, secondaryButtonDisabled, secondaryButtonHref, secondaryButtonIcon, secondaryButtonKind = "secondary", secondaryButtonPlacement, secondaryButtonText }) => {
	const blockClass = `${require_settings.pkg.prefix}--card`;
	const footerClass = `${require_settings.pkg.prefix}--card__footer`;
	const footerClasses = (0, import_classnames.default)(footerClass, { [`${footerClass}-no-button`]: !hasButton });
	return /* @__PURE__ */ react.default.createElement("div", { className: footerClasses }, secondaryButtonText && secondaryButtonPlacement === "bottom" && /* @__PURE__ */ react.default.createElement(_carbon_react.Button, {
		kind: productive ? "ghost" : secondaryButtonKind,
		onClick: onSecondaryButtonClick,
		size: "md",
		renderIcon: secondaryButtonIcon,
		href: secondaryButtonHref,
		disabled: secondaryButtonDisabled
	}, secondaryButtonText), primaryButtonText && primaryButtonPlacement === "bottom" && /* @__PURE__ */ react.default.createElement(_carbon_react.Button, {
		kind: productive ? "ghost" : primaryButtonKind,
		onClick: onPrimaryButtonClick,
		size: "md",
		renderIcon: primaryButtonIcon,
		href: primaryButtonHref,
		disabled: primaryButtonDisabled
	}, primaryButtonText), hasActions && /* @__PURE__ */ react.default.createElement("div", { className: `${blockClass}__actions` }, actions), FooterActionIcon && /* @__PURE__ */ react.default.createElement("div", { className: `${blockClass}__action-icon` }, disabled ? /* @__PURE__ */ react.default.createElement(_carbon_react_icons.Error, { size: 16 }) : /* @__PURE__ */ react.default.createElement(FooterActionIcon, null)));
};
/**@ts-ignore */
CardFooter.propTypes = {
	actions: prop_types.default.oneOfType([prop_types.default.array, prop_types.default.node]),
	disabled: prop_types.default.bool,
	footerActionIcon: prop_types.default.oneOfType([prop_types.default.func, prop_types.default.object]),
	hasActions: prop_types.default.bool,
	hasButton: prop_types.default.bool,
	onPrimaryButtonClick: prop_types.default.func,
	onSecondaryButtonClick: prop_types.default.func,
	primaryButtonDisabled: prop_types.default.bool,
	primaryButtonHref: prop_types.default.string,
	primaryButtonIcon: prop_types.default.oneOfType([prop_types.default.func, prop_types.default.object]),
	primaryButtonKind: prop_types.default.oneOf(["primary", "ghost"]),
	primaryButtonPlacement: prop_types.default.oneOf(["top", "bottom"]),
	primaryButtonText: prop_types.default.string,
	productive: prop_types.default.bool,
	secondaryButtonDisabled: prop_types.default.bool,
	secondaryButtonHref: prop_types.default.string,
	secondaryButtonIcon: prop_types.default.oneOfType([prop_types.default.func, prop_types.default.object]),
	secondaryButtonKind: prop_types.default.oneOf(["secondary", "ghost"]),
	secondaryButtonPlacement: prop_types.default.oneOf(["top", "bottom"]),
	secondaryButtonText: prop_types.default.string
};
/**@ts-ignore */
CardFooter.displayName = componentName;

//#endregion
exports.CardFooter = CardFooter;