Current Path : /home/ncdcgo/admin.ncdc.go.ug/static/js/ |
Current File : /home/ncdcgo/admin.ncdc.go.ug/static/js/517.92e57098.chunk.js.map |
{"version":3,"file":"static/js/517.92e57098.chunk.js","mappings":"2IA+CA,IA3CoB,SAAC,GAAgB,IAAdA,EAAa,EAAbA,OACrB,OACE,gBACEC,UAAU,kEACV,aAAW,aAFb,UAIE,gBAAIA,UAAU,kDAAd,WACE,eAAIA,UAAU,yCAAd,UACE,UAAC,KAAD,CACEC,GAAG,OACHD,UAAU,kHAFZ,WAIE,gBACEA,UAAU,eACVE,KAAK,eACLC,QAAQ,YACRC,MAAM,6BAJR,UAME,iBAAMC,EAAE,uMAVZ,YAFJ,OAiBGN,QAjBH,IAiBGA,OAjBH,EAiBGA,EAAQO,KAAI,SAACC,EAAOC,GACnB,OACE,gBAAIR,UAAU,2BAAd,WACE,SAAC,IAAD,CAAcS,KAAM,GAAIT,UAAU,UAClC,SAAC,KAAD,CACEC,GAAIM,EAAMG,KACVV,UAAU,gIAFZ,SAIGO,EAAMI,SANmCH,EAUjD,QAIR,C,kMCxCYI,EAAO,yCAAG,iGAASC,EAAT,EAASA,OAAT,SACRC,EAAAA,EAAAA,IAAA,iBAAoBD,IADZ,mFAAH,sDAIPE,EAAU,SAAC,GAAwB,IAAtBF,EAAqB,EAArBA,OAAQG,EAAa,EAAbA,OAChC,OAAOC,EAAAA,EAAAA,WAAS,kBACXD,GADU,IAEbE,SAAU,CAAC,OAAQL,GACnBM,QAAS,kBAAMP,EAAQ,CAAEC,OAAAA,GAAhB,IAEZ,E,iGCPYO,EAAa,SAAC,GAAsB,IAApBC,EAAmB,EAAnBA,KAAMR,EAAa,EAAbA,OACjC,OAAOC,EAAAA,EAAAA,MAAA,iBAAsBD,GAAUQ,EAAM,CAC3CC,QAAS,CACP,eAAgB,wBAGrB,EAEDF,EAAWG,UAAY,CACrBF,KAAMG,IAAAA,MAAgB,CACpBC,MAAOD,IAAAA,OAAAA,WACPE,KAAMF,IAAAA,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yI,EAAaC,EAAAA,YAZnB,SAAoBC,EAAOC,GACzB,OAAoBF,EAAAA,cAAoB,MAAOG,OAAOC,OAAO,CAC3D/I,MAAO,6BACPD,QAAS,YACTD,KAAM,eACN,cAAe,OACfoJ,IAAKL,GACJD,GAAqBD,EAAAA,cAAoB,OAAQ,CAClD1I,EAAG,4HAEN,IAGD,K","sources":["components/Layout/Breadcrumbs.jsx","features/blog/api/getPost.js","features/blog/api/updatePost.js","features/blog/components/UpdatePost.jsx","features/blog/routes/Post.jsx","features/blog/api/createPost.js","features/blog/components/CreatePost.jsx","features/blog/api/getPosts.js","features/blog/api/deletePost.js","features/blog/components/DeletePost.jsx","features/blog/components/PostsList.jsx","features/blog/routes/Posts.jsx","features/blog/routes/index.jsx","../node_modules/@heroicons/react/outline/esm/PlusIcon.js","../node_modules/@heroicons/react/solid/esm/PencilIcon.js"],"sourcesContent":["import React from \"react\";\nimport { Link } from \"react-router-dom\";\nimport { ChevronRight } from \"react-feather\";\n\nconst Breadcrumbs = ({ routes }) => {\n return (\n <nav\n className=\"flex bg-white border border-gray-200 p-2 rounded-full px-4 mt-4\"\n aria-label=\"Breadcrumb\"\n >\n <ol className=\"inline-flex items-center space-x-1 md:space-x-3\">\n <li className=\"inline-flex items-center text-gray-800\">\n <Link\n to=\"/app\"\n className=\"inline-flex items-center text-sm text-gray-800 hover:text-gray-900 dark:text-gray-800 dark:hover:text-gray-200\"\n >\n <svg\n className=\"w-4 h-4 mr-2\"\n fill=\"currentColor\"\n viewBox=\"0 0 20 20\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z\"></path>\n </svg>\n Home\n </Link>\n </li>\n {routes?.map((route, index) => {\n return (\n <li className=\"inline-flex items-center\" key={index}>\n <ChevronRight size={10} className=\"mr-4\" />\n <Link\n to={route.path}\n className=\"inline-flex items-center text-sm font-extrabold text-gray-700 hover:text-gray-900 dark:text-gray-800 dark:hover:text-gray-200\"\n >\n {route.name}\n </Link>\n </li>\n );\n })}\n </ol>\n </nav>\n );\n};\n\nBreadcrumbs.propTypes = {};\n\nexport default Breadcrumbs;\n","import { axios } from 'lib/axios';\nimport { useQuery } from 'react-query';\n\nexport const getPost = async ({ postId }) => {\n return await axios.get(`/posts/${postId}`);\n};\n\nexport const usePost = ({ postId, config }) => {\n return useQuery({\n ...config,\n queryKey: ['post', postId],\n queryFn: () => getPost({ postId }),\n });\n};\n","import { axios } from 'lib/axios';\nimport { queryClient } from 'lib/react-query';\nimport { useNotificationStore } from 'stores/notifications';\nimport PropTypes from 'prop-types';\nimport { useMutation } from 'react-query';\n\nexport const updatePost = ({ data, postId }) => {\n return axios.patch(`/posts/${postId}`, data, {\n headers: {\n 'Content-Type': 'multipart/form-data',\n },\n });\n};\n\nupdatePost.propTypes = {\n data: PropTypes.shape({\n title: PropTypes.string.isRequired,\n desc: PropTypes.string.isRequired,\n category: PropTypes.string.isRequired,\n }).isRequired,\n postId: PropTypes.string.isRequired,\n};\n \nexport const useUpdatePost = ({ config } = {}) => {\n const { addNotification } = useNotificationStore();\n\n return useMutation({\n onMutate: async (updatingPost) => {\n await queryClient.cancelQueries(['post', updatingPost?.postId]);\n\n const previousPost = queryClient.getQueryData[('post', updatingPost?.postId)];\n\n queryClient.setQueryData(['post', updatingPost?.postId], {\n ...previousPost,\n ...updatingPost.data,\n id: updatingPost.postId,\n });\n\n return { previousPost };\n },\n onError: (_, __, context) => {\n if (context?.previousPost) {\n queryClient.setQueryData(['post', context.previousPost.id], context.previousPost);\n }\n },\n onSuccess: (data) => {\n queryClient.refetchQueries(['post', data.id]);\n addNotification({\n type: 'success',\n title: 'Post Updated',\n });\n },\n ...config,\n mutationFn: updatePost,\n });\n};\n","import { Button, Spinner } from \"components/Elements\";\nimport {\n Form,\n FormDrawer,\n InputField,\n TextAreaField,\n UploadField,\n} from \"components/Form\";\nimport { Authorization, ROLES } from \"lib/authorization\";\nimport { PencilIcon } from \"@heroicons/react/solid\";\nimport PropTypes from \"prop-types\";\nimport { useState } from \"react\";\nimport * as z from \"zod\";\n\nimport { usePost } from \"../api/getPost\";\nimport { useUpdatePost } from \"../api/updatePost\";\n\nconst schema = z.object({\n title: z.string().min(1, \"Required\"),\n desc: z.string().min(1, \"Required\"),\n});\n\nexport const UpdatePost = ({ postId }) => {\n const [image, setImage] = useState(null); \n const [preview, setPreview] = useState(null);\n const [editImage, setEditImage] = useState(false);\n const postQuery = usePost({ postId }); \n const updatePostMutation = useUpdatePost();\n\n if (updatePostMutation.isLoading) {\n return (\n <div\n id=\"loading-screen\"\n className=\"w-full h-full fixed block top-0 left-0 bg-black opacity-75 z-50\"\n >\n <span className=\"opacity-75 top-1/2 my-0 mx-auto block relative w-0 h-0\">\n <Spinner size=\"sm\" />\n </span>\n </div>\n );\n }\n\n return (\n <Authorization allowedRoles={[ROLES.ADMIN]}>\n <FormDrawer\n size=\"sm\"\n isDone={updatePostMutation.isSuccess}\n triggerButton={\n <Button\n variant=\"create\"\n startIcon={<PencilIcon className=\"h-4 w-4\" />}\n size=\"sm\"\n >\n Update\n </Button>\n }\n title=\"Update Post\"\n submitButton={\n <Button\n form=\"update-post\"\n type=\"submit\"\n size=\"sm\"\n isLoading={updatePostMutation.isLoading}\n >\n Submit\n </Button>\n }\n >\n <Form\n id=\"update-post\"\n encType=\"multipart/form-data\"\n onSubmit={async (values) => {\n const { title, desc, category = \"News\" } = values;\n const bodyFormData = new FormData();\n bodyFormData.append(\"image\", image);\n bodyFormData.append(\"title\", title);\n bodyFormData.append(\"desc\", desc);\n bodyFormData.append(\"category\", category);\n await updatePostMutation.mutateAsync({\n data: bodyFormData,\n postId,\n });\n setPreview(null);\n }}\n options={{\n defaultValues: {\n title: postQuery.data?.title,\n desc: postQuery.data?.desc,\n category: postQuery.data?.category,\n image: postQuery.data?.image,\n },\n }}\n schema={schema}\n >\n {({ register, formState, watch, setValue }) => (\n <>\n <InputField\n label=\"Title\"\n error={formState.errors[\"title\"]}\n registration={register(\"title\")}\n />\n <TextAreaField\n label=\"Content\"\n error={formState.errors[\"desc\"]}\n editorContent={watch(\"desc\")}\n setValue={setValue}\n value=\"desc\"\n />\n <InputField\n label=\"Category\"\n disabled={true}\n error={formState.errors[\"category\"]}\n registration={register(\"category\")}\n />\n <span className=\"text-gray-500 text-sm\">\n Default category is set to news and can not be updated.\n </span>\n {/* button to set edit image */}\n <div className=\"flex justify-between items-center\">\n {editImage ? (\n <a\n href=\"#\"\n className=\"bg-green-400 text-gray-800 font-bold p-2 rounded text-sm\"\n onClick={(e) => {\n e.preventDefault();\n setEditImage(false);\n }}\n >\n Close\n </a>\n ) : (\n <a\n href=\"#\"\n className=\"bg-green-400 text-gray-800 font-bold p-2 rounded text-sm\"\n onClick={(e) => {\n e.preventDefault();\n setEditImage(true);\n }}\n >\n Update Image\n </a>\n )}\n </div>\n {editImage && (\n <UploadField\n title=\"Update Cover Photo\"\n subTitle=\"This will also be used as the thumbnail in feeds\"\n error={formState.errors[\"image\"]}\n x={1024}\n y={768}\n onChange={(e) => {\n setImage(e.target.files[0]);\n setPreview(URL.createObjectURL(e.target.files[0]));\n }}\n preview={preview}\n />\n )}\n </>\n )}\n </Form>\n </FormDrawer>\n </Authorization>\n );\n};\n\nUpdatePost.propTypes = {\n postId: PropTypes.string.isRequired,\n};\n","import { Spinner, MDPreview } from \"components/Elements\";\nimport { Head } from \"components/Head\";\nimport { ContentLayout } from \"components/Layout\";\nimport { UPLOADS_API_URL } from \"config\";\nimport { LazyLoadImage } from \"react-lazy-load-image-component\";\nimport { formatDate } from \"utils/format\";\nimport { useParams } from \"react-router-dom\";\n\nimport { usePost } from \"../api/getPost\";\nimport { UpdatePost } from \"../components/UpdatePost\";\nimport Breadcrumbs from \"components/Layout/Breadcrumbs\";\n\nexport const Post = () => {\n const { postId } = useParams();\n\n const postQuery = usePost({ postId });\n\n const routes = [\n {\n name: \"Posts\",\n path: \"/app/blog\", \n },\n {\n name: postQuery.data?.title,\n path: \"\",\n },\n ];\n\n if (postQuery.isLoading) {\n return (\n <div className=\"w-full h-48 flex justify-center items-center\">\n <Spinner size=\"lg\" />\n </div>\n );\n }\n\n if (!postQuery.data) return null;\n\n return (\n <>\n <Head title={postQuery.data.title} />\n <ContentLayout\n title={postQuery.data.title}\n button={<UpdatePost postId={postId} />}\n >\n <span className=\"text-xs text-gray-500 font-bold\">\n {formatDate(postQuery.data.createdAt)}\n </span> \n <Breadcrumbs routes={routes} />\n <div className=\"mt-6 flex flex-col space-y-16\">\n <div>\n <div className=\"bg-white dark:bg-gray-700 shadow overflow-hidden sm:rounded-lg\">\n <LazyLoadImage\n src={`${UPLOADS_API_URL}/${postQuery.data.image}`}\n alt=\"background for post\"\n className=\"h-48 w-full object-cover\"\n />\n <div className=\"px-4 py-5 sm:px-6 \">\n <div className=\"mt-1 text-sm text-gray-500\">\n <MDPreview value={postQuery.data.desc} />\n </div>\n </div>\n </div>\n </div>\n {/* <div>\n <Comments postId={postId} />\n </div> */}\n </div>\n </ContentLayout>\n </>\n );\n};\n","import { axios } from 'lib/axios';\nimport { queryClient } from 'lib/react-query';\nimport { useNotificationStore } from 'stores/notifications';\nimport PropTypes from 'prop-types';\nimport { useMutation } from 'react-query';\n\nexport const createPost = ({ data }) => {\n return axios.post(`/posts`, data, {\n headers: {\n 'Content-Type': 'multipart/form-data',\n },\n });\n};\n\ncreatePost.propTypes = {\n data: PropTypes.shape({\n title: PropTypes.string.isRequired,\n category: PropTypes.string.isRequired,\n }).isRequired,\n};\n\nexport const useCreatePost = ({ config } = {}) => {\n const { addNotification } = useNotificationStore();\n return useMutation({\n onMutate: async (newPost) => {\n await queryClient.cancelQueries('posts');\n\n const previousPosts = queryClient.getQueryData('posts');\n\n queryClient.setQueryData('posts', [...(previousPosts || []), newPost.data]);\n\n return { previousPosts };\n },\n onError: (_, __, context) => {\n if (context?.previousPosts) {\n queryClient.setQueryData('posts', context.previousPosts);\n }\n },\n onSuccess: () => {\n queryClient.invalidateQueries('posts');\n addNotification({\n type: 'success',\n title: 'Post Created',\n });\n },\n ...config,\n mutationFn: createPost,\n });\n};\n","import { Button, Spinner } from \"components/Elements\";\nimport {\n Form,\n FormDrawer,\n InputField,\n TextAreaField,\n UploadField,\n} from \"components/Form\";\nimport { Authorization, ROLES } from \"lib/authorization\";\nimport { PlusIcon } from \"@heroicons/react/outline\";\nimport { useState } from \"react\";\nimport * as z from \"zod\";\n\nimport { useCreatePost } from \"../api/createPost\";\n\nconst schema = z.object({\n title: z.string().min(1, \"Required\"),\n desc: z.string(),\n});\n\nexport const CreatePost = () => {\n const [image, setImage] = useState(null);\n const [preview, setPreview] = useState(null);\n const createPostMutation = useCreatePost();\n\n if (createPostMutation.isLoading) {\n return (\n <div\n id=\"loading-screen\"\n className=\"w-full h-full fixed block top-0 left-0 bg-black opacity-75 z-50\"\n >\n <span className=\"opacity-75 top-1/2 my-0 mx-auto block relative w-0 h-0\">\n <Spinner size=\"sm\" />\n </span>\n </div>\n );\n }\n\n return (\n <Authorization allowedRoles={[ROLES.ADMIN]}>\n <FormDrawer\n size=\"sm\"\n isDone={createPostMutation.isSuccess}\n triggerButton={\n <Button\n variant=\"create\"\n size=\"sm\"\n startIcon={<PlusIcon className=\"h-4 w-4\" />}\n >\n Create Post\n </Button>\n }\n title=\"Create Post\"\n submitButton={\n <Button\n form=\"create-post\"\n type=\"submit\"\n size=\"sm\"\n isLoading={createPostMutation.isLoading}\n >\n Submit\n </Button>\n }\n >\n <Form\n id=\"create-post\"\n encType=\"multipart/form-data\"\n onSubmit={async (values) => {\n const { title, desc, category = \"News\" } = values;\n const bodyFormData = new FormData();\n bodyFormData.append(\"image\", image);\n bodyFormData.append(\"title\", title);\n bodyFormData.append(\"desc\", desc);\n bodyFormData.append(\"category\", category);\n await createPostMutation.mutateAsync({ data: bodyFormData });\n }}\n schema={schema}\n >\n {({ register, formState, watch, setValue }) => (\n <>\n <InputField\n label=\"Title\"\n error={formState.errors[\"title\"]}\n registration={register(\"title\")}\n />\n <TextAreaField\n label=\"Content\"\n error={formState.errors[\"desc\"]}\n editorContent={watch(\"desc\")}\n setValue={setValue}\n value=\"desc\"\n />\n <InputField\n label=\"Category\"\n value=\"News\"\n disabled={true}\n error={formState.errors[\"category\"]}\n registration={register(\"category\")}\n />\n <span className=\"text-gray-500 text-sm\">\n Default category is set to news.\n </span>\n <UploadField\n title=\"Upload a Cover Photo\"\n subTitle=\"This will also be used as the thumbnail in feeds\"\n error={formState.errors[\"image\"]}\n x={1024}\n y={768}\n onChange={(e) => {\n setImage(e.target.files[0]);\n setPreview(URL.createObjectURL(e.target.files[0]));\n }}\n preview={preview}\n />\n </>\n )}\n </Form>\n </FormDrawer>\n </Authorization>\n );\n};\n","import { axios } from 'lib/axios';\nimport { useQuery } from 'react-query';\n\nexport const getPosts = () => {\n return axios.get('/posts');\n};\n\nexport const usePosts = ({ config } = {}) => {\n return useQuery({\n ...config,\n queryKey: ['posts'],\n queryFn: () => getPosts(),\n });\n};\n","import { axios } from 'lib/axios';\nimport { queryClient } from 'lib/react-query';\nimport { useNotificationStore } from 'stores/notifications';\nimport PropTypes from 'prop-types';\nimport { useMutation } from 'react-query';\n\nexport const deletePost = ({ postId }) => {\n return axios.delete(`/posts/${postId}`);\n};\n\ndeletePost.propTypes = {\n postId: PropTypes.string.isRequired,\n};\n\nexport const useDeletePost = ({ config } = {}) => {\n const { addNotification } = useNotificationStore();\n\n return useMutation({\n onMutate: async (deletedPost) => {\n await queryClient.cancelQueries('posts');\n\n const previousPosts = queryClient.getQueryData('posts');\n\n queryClient.setQueryData(\n 'posts',\n previousPosts?.filter((post) => post.id !== deletedPost.postId)\n );\n\n return { previousPosts };\n },\n onError: (_, __, context) => {\n if (context?.previousPosts) {\n queryClient.setQueryData('posts', context.previousPosts);\n }\n },\n onSuccess: () => {\n queryClient.invalidateQueries('posts');\n addNotification({\n type: 'success',\n title: 'Post Deleted',\n });\n },\n ...config,\n mutationFn: deletePost,\n });\n};\n","import { Button, ConfirmationDialog, Spinner } from \"components/Elements\";\nimport { Authorization, ROLES } from \"lib/authorization\";\nimport PropTypes from \"prop-types\";\n\nimport { useDeletePost } from \"../api/deletePost\";\n\nexport const DeletePost = ({ id }) => {\n const deletePostMutation = useDeletePost();\n\n if (deletePostMutation.isLoading) {\n return (\n <div\n id=\"loading-screen\"\n className=\"w-full h-full fixed block top-0 left-0 bg-black opacity-75 z-50\"\n >\n <span className=\"opacity-75 top-1/2 my-0 mx-auto block relative w-0 h-0\">\n <Spinner size=\"sm\" />\n </span>\n </div>\n );\n }\n\n return (\n\t\t<Authorization allowedRoles={[ROLES.ADMIN]}>\n\t\t\t<ConfirmationDialog\n\t\t\t\ticon=\"danger\"\n\t\t\t\ttitle=\"Delete Post\"\n\t\t\t\tbody=\"Are you sure you want to permanently remove this Post?\"\n\t\t\t\ttriggerButton={<button>Remove</button>}\n\t\t\t\tconfirmButton={\n\t\t\t\t\t<Button\n\t\t\t\t\t\tisLoading={deletePostMutation.isLoading}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclassName=\"bg-red-600\"\n\t\t\t\t\t\tonClick={async () =>\n\t\t\t\t\t\t\tawait deletePostMutation.mutateAsync({ postId: id })\n\t\t\t\t\t\t}>\n\t\t\t\t\t\tDelete Post\n\t\t\t\t\t</Button>\n\t\t\t\t}\n\t\t\t/>\n\t\t</Authorization>\n\t);\n};\n\nDeletePost.propTypes = {\n id: PropTypes.string.isRequired,\n};\n","import { Table, Spinner, Link } from \"components/Elements\";\nimport { formatDate } from \"utils/format\";\n\nimport { usePosts } from \"../api/getPosts\";\n\nimport { DeletePost } from \"./DeletePost\";\n\nexport const PostsList = () => {\n const postsQuery = usePosts();\n\n if (postsQuery.isLoading) {\n return (\n <div className=\"w-full h-48 flex justify-center items-center\">\n <Spinner size=\"lg\" />\n </div>\n );\n }\n\n if (!postsQuery.data) return null;\n\n return (\n <Table\n data={postsQuery.data}\n className=\"text-gray-400\"\n columns={[\n {\n title: \"Posts\",\n field: \"title\",\n Cell({ entry: { title, createdAt } }) {\n return (\n <>\n <span className=\"text-lg\">{title}</span>\n <br />\n <span className=\"text-xs\">\n Posted at {formatDate(createdAt)}\n </span>\n </>\n );\n },\n },\n {\n title: \"\",\n field: \"_id\",\n Cell({ entry: { _id } }) {\n return (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<div className=\"flex flex-row justify-center items-center gap-5\">\n\t\t\t\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\t\t\t\tto={`./${_id}`}\n\t\t\t\t\t\t\t\t\t\tclassName=\"mr-2 text-black dark:text-gray-200 hover:text-green-400\">\n\t\t\t\t\t\t\t\t\t\tView\n\t\t\t\t\t\t\t\t\t</Link>{\" \"}\n\t\t\t\t\t\t\t\t\t<DeletePost id={_id} />\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t);\n },\n },\n ]}\n />\n );\n};\n","import { ContentLayout } from \"components/Layout\";\nimport Breadcrumbs from \"components/Layout/Breadcrumbs\";\n\nimport { CreatePost } from \"../components/CreatePost\";\nimport { PostsList } from \"../components/PostsList\";\n\nexport const Posts = () => {\n const routes = [\n {\n name: \"Posts\",\n path: \".\",\n },\n ];\n return (\n <ContentLayout title=\"Blog\" button={<CreatePost />}>\n <Breadcrumbs routes={routes} />\n <div className=\"mt-4\">\n <PostsList />\n </div>\n </ContentLayout>\n ); \n};\n","import { Navigate, Route, Routes } from 'react-router-dom';\n\nimport { Post } from './Post';\nimport { Posts } from './Posts';\n\nexport const PostsRoutes = () => {\n return (\n <Routes>\n <Route path=\"\" element={<Posts />} />\n <Route path=\":postId\" element={<Post />} />\n <Route path=\"*\" element={<Navigate to=\".\" />} />\n </Routes>\n );\n};\n","import * as React from \"react\";\n\nfunction PlusIcon(props, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n strokeWidth: 2,\n stroke: \"currentColor\",\n \"aria-hidden\": \"true\",\n ref: svgRef\n }, props), /*#__PURE__*/React.createElement(\"path\", {\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n d: \"M12 4v16m8-8H4\"\n }));\n}\n\nconst ForwardRef = React.forwardRef(PlusIcon);\nexport default ForwardRef;","import * as React from \"react\";\n\nfunction PencilIcon(props, svgRef) {\n return /*#__PURE__*/React.createElement(\"svg\", Object.assign({\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n fill: \"currentColor\",\n \"aria-hidden\": \"true\",\n ref: svgRef\n }, props), /*#__PURE__*/React.createElement(\"path\", {\n d: \"M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z\"\n }));\n}\n\nconst ForwardRef = React.forwardRef(PencilIcon);\nexport default ForwardRef;"],"names":["routes","className","to","fill","viewBox","xmlns","d","map","route","index","size","path","name","getPost","postId","axios","usePost","config","useQuery","queryKey","queryFn","updatePost","data","headers","propTypes","PropTypes","title","desc","category","isRequired","schema","z","min","UpdatePost","useState","image","setImage","preview","setPreview","editImage","setEditImage","postQuery","updatePostMutation","addNotification","useNotificationStore","useMutation","onMutate","updatingPost","queryClient","previousPost","id","onError","_","__","context","onSuccess","type","mutationFn","useUpdatePost","isLoading","allowedRoles","ROLES","Form","isDone","isSuccess","triggerButton","variant","startIcon","PencilIcon","submitButton","form","encType","onSubmit","values","bodyFormData","FormData","append","mutateAsync","options","defaultValues","register","formState","watch","setValue","label","error","errors","registration","editorContent","value","disabled","href","onClick","e","preventDefault","subTitle","x","y","onChange","target","files","URL","createObjectURL","Post","useParams","Head","button","formatDate","createdAt","Breadcrumbs","LazyLoadImage","src","UPLOADS_API_URL","alt","createPost","CreatePost","createPostMutation","newPost","previousPosts","useCreatePost","PlusIcon","getPosts","deletePost","DeletePost","deletePostMutation","deletedPost","filter","post","useDeletePost","icon","body","confirmButton","PostsList","postsQuery","usePosts","columns","field","Cell","entry","_id","Posts","PostsRoutes","element","ForwardRef","React","props","svgRef","Object","assign","strokeWidth","stroke","ref","strokeLinecap","strokeLinejoin"],"sourceRoot":""}