{"version":3,"file":"index.js","names":["toWords","React","Fragment","QueryPresetsAccessCell","cellData","operations","_jsx","reduce","acc","operation","index","operationData","constraint","push","_jsxs","length"],"sources":["../../../../../src/elements/QueryPresets/cells/AccessCell/index.tsx"],"sourcesContent":["import type { DefaultCellComponentProps } from 'payload'\nimport type { JSX } from 'react'\n\nimport { toWords } from 'payload/shared'\nimport React, { Fragment } from 'react'\n\nexport const QueryPresetsAccessCell: React.FC = ({ cellData }) => {\n // first sort the operations in the order they should be displayed\n const operations = ['read', 'update', 'delete']\n\n return (\n

\n {operations.reduce((acc, operation, index) => {\n const operationData = (cellData as JSON)?.[operation]\n\n if (operationData && operationData.constraint) {\n acc.push(\n \n \n {toWords(operation)}: {toWords(operationData.constraint)}\n \n {index !== operations.length - 1 && ', '}\n ,\n )\n }\n return acc\n }, [] as JSX.Element[])}\n

\n )\n}\n"],"mappings":";AAGA,SAASA,OAAO,QAAQ;AACxB,OAAOC,KAAA,IAASC,QAAQ,QAAQ;AAEhC,OAAO,MAAMC,sBAAA,GAA8DA,CAAC;EAAEC;AAAQ,CAAE;EACtF;EACA,MAAMC,UAAA,GAAa,CAAC,QAAQ,UAAU,SAAS;EAE/C,oBACEC,IAAA,CAAC;cACED,UAAA,CAAWE,MAAM,CAAC,CAACC,GAAA,EAAKC,SAAA,EAAWC,KAAA;MAClC,MAAMC,aAAA,GAAiBP,QAAA,GAAoBK,SAAA,CAAU;MAErD,IAAIE,aAAA,IAAiBA,aAAA,CAAcC,UAAU,EAAE;QAC7CJ,GAAA,CAAIK,IAAI,cACNC,KAAA,CAACZ,QAAA;kCACCY,KAAA,CAAC;oCACCR,IAAA,CAAC;wBAAQN,OAAA,CAAQS,SAAA;gBAAoB,MAAGT,OAAA,CAAQW,aAAA,CAAcC,UAAU;cAEzEF,KAAA,KAAUL,UAAA,CAAWU,MAAM,GAAG,KAAK;WAJvBN,SAAA;MAOnB;MACA,OAAOD,GAAA;IACT,GAAG,EAAE;;AAGX","ignoreList":[]}