import { isJsx } from "../utils/assertion.js";
import { cs } from "../utils/styles.js";
import { useStyleConfig } from "../core/theme.js";
import vui from "../core/vui.js";
import Box from "../box/box.js";
import { useDialogContext } from "./context.js";
import DialogCancelButton from "./dialogCancelButton.js";
import DialogSubmitButton from "./dialogSubmitButton.js";
import { Fragment, jsx, jsxs } from "react/jsx-runtime";

//#region src/dialog/dialogFooter.tsx
/** Shows control buttons below the Dialog Body. By default includes cancel and submit buttons. */
const DialogFooter = vui((props, ref) => {
	const { cancelButton, children, className, submitButton, ...rest } = props;
	const styles = useStyleConfig("Dialog", useDialogContext());
	return /* @__PURE__ */ jsx(Box, {
		className: cs("vui-dialogFooter", className),
		justifyContent: "flex-end",
		p: 3,
		pt: 2,
		ref,
		...styles.footer,
		...rest,
		children: children ?? /* @__PURE__ */ jsxs(Fragment, { children: [isJsx(cancelButton) ? cancelButton : cancelButton && /* @__PURE__ */ jsx(DialogCancelButton, { ...cancelButton }), isJsx(submitButton) ? submitButton : submitButton && /* @__PURE__ */ jsx(DialogSubmitButton, { ...submitButton })] })
	});
});
DialogFooter.displayName = "DialogFooter";

//#endregion
export { DialogFooter as default };
globalThis.__vuiVersion__ = "4.0.0"
//# sourceMappingURL=dialogFooter.js.map