import { jsx as _jsx } from "@emotion/react/jsx-runtime";
import React from "react";
import { VariablesProvider } from "@qorebase/app-component";
import dot from "dot-object";
export default function ListItemVariables(props) {
    const values = React.useMemo(() => {
        const itemIds = dot.dot(props.variables);
        return Object.fromEntries(Object.entries(itemIds).map(([key, value]) => [
            // replace array bracket syntax into dot syntax
            `item.${key.replace(/(\[|\]\.|\])/g, ".")}`,
            value,
        ]));
    }, [props.variables]);
    return (_jsx(VariablesProvider, Object.assign({ values: values }, { children: props.children })));
}
//# sourceMappingURL=ListItemVariables.js.map