You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
11 KiB

2 years ago
{"ast":null,"code":"var _jsxFileName = \"/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/src/components/CardDesign2/index.js\",\n _s = $RefreshSig$();\n\nimport React, { useState } from \"react\";\nimport IconText from \"../IconText\";\nimport ButtonDivTag from \"../ButtonDivTag\";\nimport TitleSubtitle from \"../TitleSubtitle\";\nimport { DragDropContext, Droppable, Draggable } from \"react-beautiful-dnd\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst CardDesign2 = _ref => {\n _s();\n\n let {\n buttons\n } = _ref;\n const [dokmeha, updateDokmeha] = useState(buttons);\n\n function handleOnDragEnd(result) {\n if (!result.destination) return;\n const items = Array.from(dokmeha);\n const [reorderedItem] = items.splice(result.source.index, 1);\n items.splice(result.destination.index, 0, reorderedItem);\n updateDokmeha(items);\n }\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"max-h-[400px] overflow-y-auto scrollYDesign w-full flex flex-col p-4 bg-white shadow rounded mt-3\",\n children: [/*#__PURE__*/_jsxDEV(TitleSubtitle, {\n subTitle: false,\n title: \"افراد حاضر در این سالن\",\n titleClassName: \"font-bold text-primary\",\n titleBorderClassName: \"w-1 h-5 bg-green-400 ml-1.5\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 24,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(IconText, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 30,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(DragDropContext, {\n onDragEnd: handleOnDragEnd,\n children: /*#__PURE__*/_jsxDEV(Droppable, {\n droppableId: \"container\",\n children: provided => /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"flex flex-col gap-y-4 justify-around w-full\",\n ...provided.droppableProps,\n ref: provided.innerRef,\n id: \"container\",\n children: [dokmeha.map((btn, index) => /*#__PURE__*/_jsxDEV(Draggable, {\n draggableId: \"e\" + btn.id,\n index: index,\n children: provided => /*#__PURE__*/_jsxDEV(\"div\", {\n className: `w-1/2 px-1`,\n children: /*#__PURE__*/_jsxDEV(ButtonDivTag, {\n props: {\n ref: provided.innerRef,\n ...provided.draggableProps,\n ...provided.dragHandleProps\n },\n className: `${btn.className} w-full h-full text-white py-3 border-none text-xs rounded-sm`,\n style: provided.draggableProps.style,\n text: btn.name\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 48,\n columnNumber: 23\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 47,\n columnNumber: 21\n }, this)\n }, btn.id, false, {\n fileName: _jsxFileName,\n lineNumber: 41,\n columnNumber: 17\n }, this)), provided.placeholder]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 34,\n columnNumber: 13\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 32,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 31,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 23,\n columnNumber: 5\n }, this);\n};\n\n_s(CardDesign2, \"KEE5snQsBqXc0Kww9bnRe6PZ6fQ=\");\n\n_c = CardDesign2;\nexport default CardDesign2;\nCardDesign2.defaultProps = {\n buttons: [{\n id: 1,\n name: \"پنجره\",\n className: \"bg-[#FFF7BF]\"\n }, {\n id: 2,\n name: \"کمک اولیه\",\n className: \"bg-[#DBFDFF]\"\n }, {\n id: 3,\n name: \"درب خروجی\",\n className: \"bg-[#828282]\"\n }, {\n id: 4,\n name: