var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
import React, { forwardRef, useContext } from "react";
import { cl, composeEventHandlers } from "../../../utils/helpers/index.js";
import { DropdownContext } from "../../context.js";
export const GroupedItem = forwardRef((_a, ref) => {
    var { as: Component = "button", className, onClick } = _a, rest = __rest(_a, ["as", "className", "onClick"]);
    const context = useContext(DropdownContext);
    return (React.createElement("dd", { className: "aksel-dropdown__list-item" },
        React.createElement(Component, Object.assign({}, rest, { value: rest.children, onClick: composeEventHandlers(onClick, context === null || context === void 0 ? void 0 : context.onSelect), ref: ref, className: cl("aksel-dropdown__item", "aksel-body-short", "aksel-body-short--small", className) }))));
});
export default GroupedItem;
//# sourceMappingURL=GroupedItem.js.map