import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import { ActionItem } from "./actionItem";
import React, { Fragment } from "react";
import { ActionDivision } from "../../sheet/actionSheet/actionDivision";
import { Divider } from "../../divider";
export const ActionSheetContent = (props)=>{
    return /*#__PURE__*/ _jsx(_Fragment, {
        children: props.actionSheets.map((action, index)=>{
            if (action.type === "division") {
                return /*#__PURE__*/ _jsx(ActionDivision, {}, index);
            }
            return /*#__PURE__*/ _jsxs(Fragment, {
                children: [
                    /*#__PURE__*/ _jsx(ActionItem, {
                        onClick: (value)=>{
                            //
                            if (value.value === "cancel") {
                                return;
                            }
                            if (typeof action.onClick === "function") {
                                action.onClick(action);
                            // props.onClose();
                            } else {
                                props.onValueChange?.(value);
                                props.onClose?.();
                            }
                        // props.onClose();
                        },
                        index: index,
                        action: action,
                        active: typeof props.value !== "undefined" && props.value.value === action.value
                    }),
                    index < props.actionSheets.length - 1 && /*#__PURE__*/ _jsx(Divider, {
                        className: "orderly-border-base-contrast/10"
                    })
                ]
            }, action.value || index);
        })
    });
};

//# sourceMappingURL=actionSheetContent.js.map