import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
import { toWords } from 'payload/shared';
import React, { Fragment } from 'react';
export const QueryPresetsAccessCell = ({ cellData })=>{
    // first sort the operations in the order they should be displayed
    const operations = [
        'read',
        'update',
        'delete'
    ];
    return /*#__PURE__*/ _jsxDEV("p", {
        children: operations.reduce((acc, operation, index)=>{
            const operationData = cellData?.[operation];
            if (operationData && operationData.constraint) {
                acc.push(/*#__PURE__*/ _jsxDEV(Fragment, {
                    children: [
                        /*#__PURE__*/ _jsxDEV("span", {
                            children: [
                                /*#__PURE__*/ _jsxDEV("strong", {
                                    children: toWords(operation)
                                }, void 0, false, {
                                    fileName: "src/elements/QueryPresets/cells/AccessCell/index.tsx",
                                    lineNumber: 20,
                                    columnNumber: 17
                                }, this),
                                ": ",
                                toWords(operationData.constraint)
                            ]
                        }, void 0, true, {
                            fileName: "src/elements/QueryPresets/cells/AccessCell/index.tsx",
                            lineNumber: 19,
                            columnNumber: 15
                        }, this),
                        index !== operations.length - 1 && ', '
                    ]
                }, operation, true, {
                    fileName: "src/elements/QueryPresets/cells/AccessCell/index.tsx",
                    lineNumber: 18,
                    columnNumber: 13
                }, this));
            }
            return acc;
        }, [])
    }, void 0, false, {
        fileName: "src/elements/QueryPresets/cells/AccessCell/index.tsx",
        lineNumber: 12,
        columnNumber: 5
    }, this);
};

//# sourceMappingURL=index.js.map