/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
"use client";
import { cx, getStyles } from "../../../styles/styler.js";
import { HStack } from "../../HStack.js";
import { useInternalModalContext } from "./ModalContext.js";
import { useModalConfig } from "./UDSModalConfigProvider.js";
import { jsx, jsxs } from "react/jsx-runtime";
//#region src/components/client/Modal/ModalActions.tsx
const ModalActions = ({ children, asChild = void 0, startContent, slotProps }) => {
	const { size } = useModalConfig();
	const { hasContent, shouldRenderHeader } = useInternalModalContext();
	const classNames = {
		actions: getStyles({
			modalSizeSpacingHorizontal: size,
			modalSizeActions: size,
			flexDirection: "row-reverse",
			justifyContent: "space-between",
			alignItems: "center"
		}),
		actionsInner: getStyles({
			flexDirection: "row-reverse",
			alignItems: "center",
			className: cx("gap-[inherit]")
		}),
		startContent: getStyles({
			alignItems: "center",
			className: cx("gap-[inherit]")
		})
	};
	return /* @__PURE__ */ jsxs(HStack, {
		...slotProps?.root,
		className: cx(classNames.actions, slotProps?.root?.className),
		style: {
			paddingTop: !hasContent && shouldRenderHeader ? 0 : void 0,
			...slotProps?.root?.style
		},
		children: [/* @__PURE__ */ jsx(HStack, {
			asChild,
			...slotProps?.actionsInner,
			className: cx(classNames.actionsInner, slotProps?.actionsInner?.className),
			children
		}), startContent && /* @__PURE__ */ jsx(HStack, {
			...slotProps?.startContent,
			className: cx(classNames.startContent, slotProps?.startContent?.className),
			children: startContent
		})]
	});
};
ModalActions.displayName = "ModalActions";
ModalActions.__modalSlot = "actions";
//#endregion
export { ModalActions };
