Your IP : 18.117.105.184


Current Path : /home/ncdcgo/admin.ncdc.go.ug/static/js/
Upload File :
Current File : /home/ncdcgo/admin.ncdc.go.ug/static/js/897.4bed85b1.chunk.js.map

{"version":3,"file":"static/js/897.4bed85b1.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,yKCpCYI,EAAc,SAAC,GAA4B,IAA1BC,EAAyB,EAAzBA,WAAYC,EAAa,EAAbA,OACxC,OAAOC,EAAAA,EAAAA,WAAS,kBACXD,GADU,IAEbE,SAAU,CAAC,WAAYH,GACvBI,QAAS,kBARc,SAAC,GAAoB,IAAlBJ,EAAiB,EAAjBA,WAC5B,OAAOK,EAAAA,EAAAA,IAAA,qBAAwBL,GAChC,CAMkBM,CAAY,CAAEN,WAAAA,GAApB,IAEZ,E,oECPYO,EAAmB,SAAC,GAAoB,IAAlBP,EAAiB,EAAjBA,WACjC,OAAOK,EAAAA,EAAAA,MAAA,8BAAmCL,GAC3C,EAEDO,EAAiBC,UAAY,CAC3BR,WAAYS,IAAAA,OAAAA,YAGP,I,8ICd+XC,GAAEC,EAAAA,EAAAA,eAAE,MAAM,SAASC,IAAI,IAAIC,GAAEC,EAAAA,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AM6P,EAAaC,EAAAA,YAhBnB,SAAkB/M,EAAOgN,GACvB,OAAoBD,EAAAA,cAAoB,MAAOlJ,OAAOC,OAAO,CAC3D1G,MAAO,6BACPF,KAAM,OACNC,QAAS,YACT8P,YAAa,EACbC,OAAQ,eACR,cAAe,OACftM,IAAKoM,GACJhN,GAAqB+M,EAAAA,cAAoB,OAAQ,CAClDI,cAAe,QACfC,eAAgB,QAChB/P,EAAG,mBAEN,IAGD,K,qCCLA,IAAMyP,EAAaC,EAAAA,YAZnB,SAAoB/M,EAAOgN,GACzB,OAAoBD,EAAAA,cAAoB,MAAOlJ,OAAOC,OAAO,CAC3D1G,MAAO,6BACPD,QAAS,YACTD,KAAM,eACN,cAAe,OACf0D,IAAKoM,GACJhN,GAAqB+M,EAAAA,cAAoB,OAAQ,CAClD1P,EAAG,4HAEN,IAGD,K","sources":["components/Layout/Breadcrumbs.jsx","features/resources/api/getResource.js","features/resources/api/abridgedResource.js","../node_modules/@headlessui/react/dist/components/label/label.js","../node_modules/@headlessui/react/dist/components/switch/switch.js","../node_modules/@headlessui/react/dist/utils/form.js","features/resources/api/approveResource.js","features/resources/components/ApproveResource.jsx","features/resources/api/updateResource.js","features/resources/components/UpdateResource.jsx","features/resources/api/updateResourceAsset.js","features/resources/components/UpdateResourceAsset.jsx","features/resources/routes/Resource.jsx","features/resources/api/createResource.js","features/resources/components/CreateResource.jsx","features/resources/api/getResources.js","features/resources/api/deleteResource.js","features/resources/components/DeleteResource.jsx","features/resources/components/ResourcesList.jsx","features/resources/routes/Resources.jsx","features/resources/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 getResource = ({ resourceId }) => {\n  return axios.get(`/resources/${resourceId}`);\n};\n\nexport const useResource = ({ resourceId, config }) => {\n  return useQuery({\n    ...config,\n    queryKey: ['resource', resourceId],\n    queryFn: () => getResource({ resourceId }),\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 abridgedResource = ({ resourceId }) => {\n  return axios.patch(`/resources/abridged/${resourceId}`);\n};\n\nabridgedResource.propTypes = {\n  resourceId: PropTypes.string.isRequired,\n};\n\nexport const useAbridgedResource = ({ config } = {}) => {\n  const { addNotification } = useNotificationStore();\n\n  return useMutation({\n    onMutate: async (approvingResource) => {\n      await queryClient.cancelQueries(['resource', approvingResource?.resourceId]);\n\n      const previousResource =\n        queryClient.getQueryData[('resource', approvingResource?.resourceId)];\n\n      queryClient.setQueryData(['resource', approvingResource?.resourceId], {\n        ...previousResource,\n        id: approvingResource.resourceId,\n      });\n\n      return { previousResource };\n    },\n    onError: (_, __, context) => {\n      if (context?.previousResource) {\n        queryClient.setQueryData(\n          ['resource', context.previousResource.id],\n          context.previousResource\n        );\n      }\n    },\n    onSuccess: (data) => {\n      queryClient.refetchQueries(['resource', data.id]);\n      addNotification({\n        type: 'success',\n        title: 'Resource Updated',\n      });\n    },\n    ...config,\n    mutationFn: abridgedResource,\n  });\n};\n","import p,{createContext as m,useContext as L,useMemo as f,useState as b}from\"react\";import{useId as g}from\"../../hooks/use-id.js\";import{forwardRefWithAs as x,render as T}from\"../../utils/render.js\";import{useIsoMorphicEffect as E}from\"../../hooks/use-iso-morphic-effect.js\";import{useSyncRefs as P}from\"../../hooks/use-sync-refs.js\";import{useEvent as v}from\"../../hooks/use-event.js\";let u=m(null);function c(){let o=L(u);if(o===null){let t=new Error(\"You used a <Label /> component, but it is not inside a relevant parent.\");throw Error.captureStackTrace&&Error.captureStackTrace(t,c),t}return o}function M(){let[o,t]=b([]);return[o.length>0?o.join(\" \"):void 0,f(()=>function(e){let l=v(a=>(t(i=>[...i,a]),()=>t(i=>{let n=i.slice(),d=n.indexOf(a);return d!==-1&&n.splice(d,1),n}))),r=f(()=>({register:l,slot:e.slot,name:e.name,props:e.props}),[l,e.slot,e.name,e.props]);return p.createElement(u.Provider,{value:r},e.children)},[t])]}let h=\"label\",F=x(function(t,s){let{passive:e=!1,...l}=t,r=c(),a=`headlessui-label-${g()}`,i=P(s);E(()=>r.register(a),[a,r.register]);let n={ref:i,...r.props,id:a};return e&&(\"onClick\"in n&&delete n.onClick,\"onClick\"in l&&delete l.onClick),T({ourProps:n,theirProps:l,slot:r.slot||{},defaultTag:h,name:r.name||\"Label\"})});export{F as Label,M as useLabels};\n","import o,{Fragment as D,createContext as L,useContext as k,useMemo as b,useRef as R,useState as C}from\"react\";import{forwardRefWithAs as A,render as y,compact as H}from\"../../utils/render.js\";import{useId as G}from\"../../hooks/use-id.js\";import{Keys as T}from\"../keyboard.js\";import{isDisabledReactIssue7711 as K}from\"../../utils/bugs.js\";import{Label as M,useLabels as x}from\"../label/label.js\";import{Description as U,useDescriptions as _}from\"../description/description.js\";import{useResolveButtonType as F}from\"../../hooks/use-resolve-button-type.js\";import{useSyncRefs as B}from\"../../hooks/use-sync-refs.js\";import{Hidden as I,Features as W}from\"../../internal/hidden.js\";import{attemptSubmit as O}from\"../../utils/form.js\";import{useEvent as a}from\"../../hooks/use-event.js\";let p=L(null);p.displayName=\"GroupContext\";let j=D;function N(m){let[n,i]=C(null),[r,s]=x(),[l,c]=_(),d=b(()=>({switch:n,setSwitch:i,labelledby:r,describedby:l}),[n,i,r,l]),u={},e=m;return o.createElement(c,{name:\"Switch.Description\"},o.createElement(s,{name:\"Switch.Label\",props:{onClick(){!n||(n.click(),n.focus({preventScroll:!0}))}}},o.createElement(p.Provider,{value:d},y({ourProps:u,theirProps:e,defaultTag:j,name:\"Switch.Group\"}))))}let $=\"button\",q=A(function(n,i){let{checked:r,onChange:s,name:l,value:c,...d}=n,u=`headlessui-switch-${G()}`,e=k(p),f=R(null),S=B(f,i,e===null?null:e.setSwitch),h=a(()=>s(!r)),E=a(t=>{if(K(t.currentTarget))return t.preventDefault();t.preventDefault(),h()}),w=a(t=>{t.key===T.Space?(t.preventDefault(),h()):t.key===T.Enter&&O(t.currentTarget)}),P=a(t=>t.preventDefault()),v=b(()=>({checked:r}),[r]),g={id:u,ref:S,role:\"switch\",type:F(n,f),tabIndex:0,\"aria-checked\":r,\"aria-labelledby\":e==null?void 0:e.labelledby,\"aria-describedby\":e==null?void 0:e.describedby,onClick:E,onKeyUp:w,onKeyPress:P};return o.createElement(o.Fragment,null,l!=null&&r&&o.createElement(I,{features:W.Hidden,...H({as:\"input\",type:\"checkbox\",hidden:!0,readOnly:!0,checked:r,name:l,value:c})}),y({ourProps:g,theirProps:d,slot:v,defaultTag:$,name:\"Switch\"}))}),ue=Object.assign(q,{Group:N,Label:M,Description:U});export{ue as Switch};\n","function e(n={},r=null,t=[]){for(let[i,o]of Object.entries(n))f(t,s(r,i),o);return t}function s(n,r){return n?n+\"[\"+r+\"]\":r}function f(n,r,t){if(Array.isArray(t))for(let[i,o]of t.entries())f(n,s(r,i.toString()),o);else t instanceof Date?n.push([r,t.toISOString()]):typeof t==\"boolean\"?n.push([r,t?\"1\":\"0\"]):typeof t==\"string\"?n.push([r,t]):typeof t==\"number\"?n.push([r,`${t}`]):t==null?n.push([r,\"\"]):e(t,r,n)}function p(n){var t;let r=(t=n==null?void 0:n.form)!=null?t:n.closest(\"form\");if(!!r){for(let i of r.elements)if(i.tagName===\"INPUT\"&&i.type===\"submit\"||i.tagName===\"BUTTON\"&&i.type===\"submit\"||i.nodeName===\"INPUT\"&&i.type===\"image\"){i.click();return}}}export{p as attemptSubmit,e as objectToFormEntries};\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 approveResource = ({ resourceId }) => {\n  return axios.patch(`/resources/approve/${resourceId}`);\n};\n\napproveResource.propTypes = {\n  resourceId: PropTypes.string.isRequired,\n};\n\nexport const useApproveResource = ({ config } = {}) => {\n  const { addNotification } = useNotificationStore();\n\n  return useMutation({\n    onMutate: async (approvingResource) => {\n      await queryClient.cancelQueries(['resource', approvingResource?.resourceId]);\n\n      const previousResource =\n        queryClient.getQueryData[('resource', approvingResource?.resourceId)];\n\n      queryClient.setQueryData(['resource', approvingResource?.resourceId], {\n        ...previousResource,\n        id: approvingResource.resourceId,\n      });\n\n      return { previousResource };\n    },\n    onError: (_, __, context) => {\n      if (context?.previousResource) {\n        queryClient.setQueryData(\n          ['resource', context.previousResource.id],\n          context.previousResource\n        );\n      }\n    },\n    onSuccess: (data) => {\n      queryClient.refetchQueries(['resource', data.id]);\n      addNotification({\n        type: 'success',\n        title: 'Resource Updated',\n      });\n    },\n    ...config,\n    mutationFn: approveResource,\n  });\n};\n","import { Spinner } from 'components/Elements';\nimport { Form } from 'components/Form';\nimport { Authorization, ROLES } from 'lib/authorization';\nimport { Switch } from '@headlessui/react';\nimport PropTypes from 'prop-types';\nimport { useState } from 'react';\n\nimport { useApproveResource } from '../api/approveResource';\nimport { useResource } from '../api/getResource';\n\nexport const ApproveResource = ({ resourceId }) => {\n  const updateResourceMutation = useApproveResource();\n  const resourceQuery = useResource({ resourceId });\n  const [enabled, setEnabled] = useState(resourceQuery.data?.approved);\n\n  const onChange = () => async () => {\n    setEnabled(!enabled);\n    await updateResourceMutation.mutateAsync({ resourceId });\n  };\n\n  if (updateResourceMutation.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      <Form id=\"update-resource\">\n        {() => (\n          <>\n            <Switch.Group>\n              <div className=\"flex items-center\">\n                <Switch.Label className=\"mr-4\">Approved</Switch.Label>\n                <Switch\n                  checked={enabled}\n                  onChange={onChange()}\n                  className={`${\n                    enabled ? 'bg-green-600' : 'bg-gray-600'\n                  } relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2`}\n                >\n                  <span\n                    className={`${\n                      enabled ? 'translate-x-6' : 'translate-x-1'\n                    } inline-block h-4 w-4 transform rounded-full bg-white transition-transform`}\n                  />\n                </Switch>\n              </div>\n            </Switch.Group>\n          </>\n        )}\n      </Form>\n    </Authorization>\n  );\n};\n\nApproveResource.propTypes = {\n  resourceId: PropTypes.string.isRequired,\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 updateResource = ({ data, resourceId }) => {\n  return axios.patch(`/resources/${resourceId}`, data);\n};\n\nupdateResource.propTypes = {\n  data: PropTypes.shape({\n    title: PropTypes.string.isRequired,\n    price: PropTypes.string.isRequired,\n    desc: PropTypes.string.isRequired,\n    curriculum: PropTypes.string.isRequired,\n  }).isRequired,\n  resourceId: PropTypes.string.isRequired,\n};\n\nexport const useUpdateResource = ({ config } = {}) => {\n  const { addNotification } = useNotificationStore();\n\n  return useMutation({\n    onMutate: async (updatingResource) => {\n      await queryClient.cancelQueries(['resource', updatingResource?.resourceId]);\n\n      const previousResource = queryClient.getQueryData[('resource', updatingResource?.resourceId)];\n\n      queryClient.setQueryData(['resource', updatingResource?.resourceId], {\n        ...previousResource,\n        ...updatingResource.data,\n        id: updatingResource.resourceId,\n      });\n\n      return { previousResource };\n    },\n    onError: (_, __, context) => {\n      if (context?.previousResource) {\n        queryClient.setQueryData(\n          ['resource', context.previousResource.id],\n          context.previousResource\n        );\n      }\n    },\n    onSuccess: (data) => {\n      queryClient.refetchQueries(['resource', data.id]);\n      addNotification({\n        type: 'success',\n        title: 'Resource Updated',\n      });\n    },\n    ...config,\n    mutationFn: updateResource,\n  });\n};\n","import { Button, Spinner } from \"components/Elements\";\nimport {\n  Form,\n  FormDrawer,\n  InputField,\n  SelectField,\n  TextAreaField,\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 { useResource } from \"../api/getResource\";\nimport { useUpdateResource } from \"../api/updateResource\";\n\nconst schema = z.object({\n  title: z.string().min(1, \"Required\"),\n  resourceType: z.string().min(1, \"Required\"),\n  curriculum: z.string().min(1, \"Required\"),\n  subjectOrCourse: z.string().min(1, \"Required\"),\n  price: z.string(),\n  desc: z.string(),\n});\n\nconst curriculumsQuery = [\n  { label: \"ECCE Curriculum\", value: \"ECCE Curriculum\" },\n  { label: \"Primary Curriculum\", value: \"Primary Curriculum\" },\n  { label: \"Secondary Curriculum\", value: \"Secondary Curriculum\" },\n  { label: \"BTVET Curriculum\", value: \"BTVET Curriculum\" },\n  { label: \"Abridged Curriculum\", value: \"Abridged Curriculum\" },\n  {\n    label: \"Accelerated Education Programe\",\n    value: \"Accelerated Education Programe\",\n  },\n];\n\nconst resourceTypesQuery = [\n  { label: \"Syllabus Books\", value: \"Syllabus Books\" },\n  {\n    label: \"Textbooks and Teachers Guides\",\n    value: \"Textbooks and Teachers Guides\",\n  },\n  {\n    label: \"Home Study Learning\",\n    value: \"Home Study Learning\",\n  },\n];\n\nconst ecceCurriculum = [\n  {\n    label: \"Basic Education Curriculum Framework for Uganda\",\n    value: \"Basic Education Curriculum Framework for Uganda\",\n  },\n  {\n    label: \"Learning Framework for Early Childhood Development (3 - 6 Years)\",\n    value: \"Learning Framework for Early Childhood Development (3 - 6 Years)\",\n  },\n  {\n    label: \"Caregivers Guide to the Learning Framework (3 - 6 Years)\",\n    value: \"Caregivers Guide to the Learning Framework (3 - 6 Years)\",\n  },\n  {\n    label: \"Thematic (Lower Primary) Curriculum\",\n    value: \"Thematic (Lower Primary) Curriculum\",\n  },\n];\n\nconst primaryCurriculum = [\n  { label: \"Upper Primary Curriculum\", value: \"Upper Primary Curriculum\" },\n  { label: \"Transition Curriculum\", value: \"Transition Curriculum\" },\n];\n\nconst secondaryCurriculum = [\n  {\n    label: \"O Level Curriculum (Revised, Competency-based)\",\n    value: \"O Level Curriculum (Revised, Competency-based)\",\n  },\n  { label: \"A Level Curriculum\", value: \"A Level Curriculum\" },\n];\n\nconst btvetCurriculum = [\n  { label: \"Certificate Courses\", value: \"Certificate Courses\" },\n  { label: \"Diploma Programs\", value: \"Diploma Programs\" },\n];\n\nconst abridgedCurriculum = [\n  {\n    label: \"Primary 2\",\n    value: \"Primary 2\",\n  },\n  {\n    label: \"Primary 3\",\n    value: \"Primary 3\",\n  },\n  {\n    label: \"Primary 4\",\n    value: \"Primary 4\",\n  },\n  {\n    label: \"Primary 5\",\n    value: \"Primary 5\",\n  },\n  {\n    label: \"Primary 6\",\n    value: \"Primary 6\",\n  },\n  {\n    label: \"Primary 7\",\n    value: \"Primary 7\",\n  },\n  {\n    label: \"Senior 2\",\n    value: \"Senior 2\",\n  },\n  {\n    label: \"Senior 3\",\n    value: \"Senior 3\",\n  },\n  {\n    label: \"Senior 4\",\n    value: \"Senior 4\",\n  },\n  {\n    label: \"Senior 5\",\n    value: \"Senior 5\",\n  },\n  {\n    label: \"Senior 6\",\n    value: \"Senior 6\",\n  },\n];\n\nconst acceleratedEducationPrograme = [\n  {\n    label: \"Special Needs Education (SNE)\",\n    value: \"Special Needs Education (SNE)\",\n  },\n  {\n    label: \"Pastoral and fishing communities\",\n    value: \"Pastoral and fishing communities\",\n  },\n  {\n    label: \"Refugees and host communities\",\n    value: \"Refugees and host communities\",\n  },\n];\n\nexport const UpdateResource = ({ resourceId }) => {\n  const resourceQuery = useResource({ resourceId });\n  const updateResourceMutation = useUpdateResource();\n  const [active, setActive] = useState(resourceQuery.data?.curriculum);\n\n  if (updateResourceMutation.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={updateResourceMutation.isSuccess}\n        triggerButton={\n          <Button\n            variant=\"create\"\n            startIcon={<PencilIcon className=\"h-4 w-4\" />}\n            size=\"sm\"\n          >\n            Update Resource\n          </Button>\n        }\n        title=\"Update Resource\"\n        submitButton={\n          <Button\n            form=\"update-resource-details\"\n            type=\"submit\"\n            size=\"sm\"\n            isLoading={updateResourceMutation.isLoading}\n          >\n            Submit\n          </Button>\n        }\n      >\n        <Form\n          id=\"update-resource-details\"\n          onSubmit={async (values) => {\n            const {\n              title,\n              price,\n              desc,\n              resourceType,\n              curriculum,\n              subjectOrCourse,\n            } = values;\n\n            const bodyFormData = new FormData();\n            bodyFormData.append(\"title\", title);\n            bodyFormData.append(\"price\", price);\n            bodyFormData.append(\"resourceType\", resourceType);\n            bodyFormData.append(\"desc\", desc);\n            bodyFormData.append(\"curriculum\", curriculum);\n            bodyFormData.append(\"subjectOrCourse\", subjectOrCourse);\n            console.log(values);\n            await updateResourceMutation.mutateAsync({\n              data: values,\n              resourceId,\n            });\n          }}\n          options={{\n            defaultValues: {\n              title: resourceQuery.data?.title,\n              resourceType: resourceQuery.data?.resourceType,\n              price: resourceQuery.data?.price || \"\",\n              desc: resourceQuery.data?.desc,\n              curriculum: resourceQuery.data?.curriculum,\n              subjectOrCourse: resourceQuery.data?.subjectOrCourse,\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              <InputField\n                label=\"Price\"\n                error={formState.errors[\"price\"]}\n                registration={register(\"price\")}\n              />\n              <TextAreaField\n                label=\"Description\"\n                error={formState.errors[\"desc\"]}\n                editorContent={watch(\"desc\")}\n                setValue={setValue}\n                value=\"desc\"\n              />\n              <SelectField\n                label=\"Select Resource Type\"\n                error={formState.errors[\"resourceType\"]}\n                registration={register(\"resourceType\")}\n                options={resourceTypesQuery}\n              />\n              <SelectField\n                label=\"Select Curriculum\"\n                error={formState.errors[\"curriculum\"]}\n                registration={register(\"curriculum\")}\n                options={curriculumsQuery}\n                onChange={(e) => setActive(e.target.value)}\n              />\n              {active === \"ECCE Curriculum\" && (\n                <SelectField\n                  label=\"Select Subject or Course(ECCE)\"\n                  error={formState.errors[\"subjectOrCourse\"]}\n                  registration={register(\"subjectOrCourse\")}\n                  options={ecceCurriculum?.map((curriculum) => ({\n                    label: curriculum.label,\n                    value: curriculum.value,\n                  }))}\n                />\n              )}\n              {active === \"Primary Curriculum\" && (\n                <SelectField\n                  label=\"Select Subject or Course(Primary)\"\n                  error={formState.errors[\"subjectOrCourse\"]}\n                  registration={register(\"subjectOrCourse\")}\n                  options={primaryCurriculum?.map((curriculum) => ({\n                    label: curriculum.label,\n                    value: curriculum.value,\n                  }))}\n                />\n              )}\n              {active === \"Secondary Curriculum\" && (\n                <SelectField\n                  label=\"Select Subject or Course(Secondary)\"\n                  error={formState.errors[\"subjectOrCourse\"]}\n                  registration={register(\"subjectOrCourse\")}\n                  options={secondaryCurriculum?.map((curriculum) => ({\n                    label: curriculum.label,\n                    value: curriculum.value,\n                  }))}\n                />\n              )}\n              {active === \"BTVET Curriculum\" && (\n                <SelectField\n                  label=\"Select Subject or Course(BTVET)\"\n                  error={formState.errors[\"subjectOrCourse\"]}\n                  registration={register(\"subjectOrCourse\")}\n                  options={btvetCurriculum?.map((curriculum) => ({\n                    label: curriculum.label,\n                    value: curriculum.value,\n                  }))}\n                />\n              )}\n              {active === \"Abridged Curriculum\" && (\n                <SelectField\n                  label=\"Select Subject or Course(BTVET)\"\n                  error={formState.errors[\"subjectOrCourse\"]}\n                  registration={register(\"subjectOrCourse\")}\n                  options={abridgedCurriculum?.map((curriculum) => ({\n                    label: curriculum.label,\n                    value: curriculum.value,\n                  }))}\n                />\n              )}\n              {active === \"Accelerated Education Programe\" && (\n                <SelectField\n                  label=\"Select Subject or Course(Accelerated Education Programe)\"\n                  error={formState.errors[\"subjectOrCourse\"]}\n                  registration={register(\"subjectOrCourse\")}\n                  options={acceleratedEducationPrograme?.map((curriculum) => ({\n                    label: curriculum.label,\n                    value: curriculum.value,\n                  }))}\n                />\n              )}\n            </>\n          )}\n        </Form>\n      </FormDrawer>\n    </Authorization>\n  );\n};\n\nUpdateResource.propTypes = {\n  resourceId: PropTypes.string.isRequired,\n};\n\n// import { Button } from 'components/Elements';\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 updateResourceAsset = ({ data, resourceId }) => {\n  return axios.patch(`/resources/${resourceId}`, data, {\n    headers: {\n      'Content-Type': 'multipart/form-data',\n    },\n  });\n};\n\nupdateResourceAsset.propTypes = {\n  data: PropTypes.shape({\n    cover: PropTypes.object,\n    resource: PropTypes.object,\n  }).isRequired,\n  resourceId: PropTypes.string.isRequired,\n};\n\nexport const useUpdateResourceAsset = ({ config } = {}) => {\n  const { addNotification } = useNotificationStore();\n\n  return useMutation({\n    onMutate: async (updatingResourceAsset) => {\n      await queryClient.cancelQueries(['resourceAsset', updatingResourceAsset?.resourceId]);\n\n      const previousResourceAsset =\n        queryClient.getQueryData[('resourceAsset', updatingResourceAsset?.resourceId)];\n\n      queryClient.setQueryData(['resourceAsset', updatingResourceAsset?.resourceId], {\n        ...previousResourceAsset,\n        ...updatingResourceAsset.data,\n        id: updatingResourceAsset.resourceId,\n      });\n\n      return { previousResourceAsset };\n    },\n    onError: (_, __, context) => {\n      if (context?.previousResourceAsset) {\n        queryClient.setQueryData(\n          ['resourceAsset', context.previousResourceAsset.id],\n          context.previousResourceAsset\n        );\n      }\n    },\n    onSuccess: (data) => {\n      queryClient.refetchQueries(['resourceAsset', data.id]);\n      addNotification({\n        type: 'success',\n        title: 'Resource Assets Updated',\n      });\n    },\n    ...config,\n    mutationFn: updateResourceAsset,\n  });\n};\n","import { Button, Spinner } from \"components/Elements\";\nimport {\n  DocumentUploadField,\n  Form,\n  FormDrawer,\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 { useResource } from \"../api/getResource\";\nimport { useUpdateResourceAsset } from \"../api/updateResourceAsset\";\n\nconst schema = z.object({});\n\nexport const UpdateResourceAsset = ({ resourceId }) => {\n  const [cover, setCover] = useState(null);\n  const [resource, setResource] = useState(null);\n  const [preview, setPreview] = useState(null);\n  const resourceQuery = useResource({ resourceId });\n  const updateResourceAssetMutation = useUpdateResourceAsset();\n\n  if (updateResourceAssetMutation.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={updateResourceAssetMutation.isSuccess}\n        triggerButton={\n          <Button\n            variant=\"create\"\n            startIcon={<PencilIcon className=\"h-4 w-4\" />}\n            size=\"sm\"\n          >\n            Update Cover & Resource File\n          </Button>\n        }\n        title=\"Update Resource Asset\"\n        submitButton={\n          <Button\n            form=\"update-resource-assets\"\n            type=\"submit\"\n            size=\"sm\"\n            isLoading={updateResourceAssetMutation.isLoading}\n          >\n            Submit\n          </Button>\n        }\n      >\n        <Form\n          id=\"update-resource-assets\"\n          // encType=\"multipart/form-data\"\n          onSubmit={async () => {\n            const bodyFormData = new FormData();\n            bodyFormData.append(\"cover\", cover);\n            bodyFormData.append(\"resource\", resource);\n            await updateResourceAssetMutation.mutateAsync({\n              data: bodyFormData,\n              resourceId,\n            });\n            setPreview(null);\n          }}\n          options={{\n            defaultValues: {\n              cover: resourceQuery.data?.cover,\n              resource: resourceQuery.data?.resource,\n            },\n          }}\n          schema={schema}\n        >\n          {({ formState }) => (\n            <>\n              <UploadField\n                title=\"Update Cover Photo\"\n                subTitle=\"This will also be used as the thumbnail in resource feeds\"\n                error={formState.errors[\"cover\"]}\n                x={500}\n                y={700}\n                onChange={(e) => {\n                  setCover(e.target.files[0]);\n                  setPreview(URL.createObjectURL(e.target.files[0]));\n                }}\n                preview={preview}\n              />\n              <DocumentUploadField\n                label=\"Update Resource File\"\n                accept=\"application/pdf\"\n                error={formState.errors[\"resource\"]}\n                onChange={(e) => {\n                  setResource(e.target.files[0]);\n                }}\n              />\n            </>\n          )}\n        </Form>\n      </FormDrawer>\n    </Authorization>\n  );\n};\n\nUpdateResourceAsset.propTypes = {\n  resourceId: 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 { formatDate } from \"utils/format\";\nimport { ChevronLeft } from \"react-feather\";\nimport { Link, useParams } from \"react-router-dom\";\n\nimport { useResource } from \"../api/getResource\";\nimport { AbridgedResource } from \"../components/AbridgedResource\";\nimport { ApproveResource } from \"../components/ApproveResource\";\nimport { UpdateResource } from \"../components/UpdateResource\";\nimport { UpdateResourceAsset } from \"../components/UpdateResourceAsset\";\nimport Breadcrumbs from \"components/Layout/Breadcrumbs\";\n\nexport const Resource = () => {\n  const { resourceId } = useParams();\n  const resourceQuery = useResource({ resourceId });\n\n  if (resourceQuery.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  const routes = [\n    {\n      name: \"Resources\",\n      path: \"/app/resources\",\n    },\n    {\n      name: resourceQuery.data?.title,\n      path: \"\",\n    },\n  ];\n\n  if (!resourceQuery.data) return null;\n\n  return (\n    <>\n      <Head title={resourceQuery.data.title} />\n      <ContentLayout\n        title={resourceQuery.data.title}\n        button={<UpdateResource resourceId={resourceId} />}\n      >\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              <div className=\"px-4 py-5 sm:px-6\">\n                <div className=\"grid grid-cols-3 gap-4\">\n                  <div className=\"col-span-2 mt-1 text-sm text-gray-400\">\n                    {/* preview pdf */}\n                    <span className=\"font-bold text-lg\">\n                      {resourceQuery.data.title}\n                    </span>\n                    <div className=\"bg-gray-100 dark:bg-gray-800 p-4 my-4\">\n                      <span className=\"text-xs text-gray-500\">Description</span>\n                      <MDPreview value={resourceQuery.data.desc} />\n                    </div>\n                    <span className=\"font-bold\">Resource Type:</span>{\" \"}\n                    <span>{resourceQuery.data.resourceType}</span>\n                    <br />\n                    <span className=\"font-bold\">Curriculum:</span>{\" \"}\n                    <span>{resourceQuery.data.curriculum}</span>\n                    <br />\n                    <span className=\"font-bold\">Subject: </span>{\" \"}\n                    <span>{resourceQuery.data.subjectOrCourse}</span>\n                    <br />\n                    <span className=\"font-bold\">Price: </span>{\" \"}\n                    <span>\n                      {resourceQuery.data.price === (0 || null)\n                        ? `Free`\n                        : resourceQuery.data.price}\n                    </span>\n                    {/* Update resource assets */}\n                    <div className=\"my-4\">\n                      <UpdateResourceAsset resourceId={resourceId} />\n                    </div>\n                    <span className=\"font-bold\">Last Updated: </span>{\" \"}\n                    <span>{formatDate(resourceQuery.data.updatedAt)}</span>\n                    <br />\n                    <div className=\"my-4 space-x-4\">\n                      <ApproveResource resourceId={resourceId} />\n                    </div>\n                  </div>\n                  <div className=\"mt-1\">\n                    <img\n                      src={UPLOADS_API_URL + \"/\" + resourceQuery.data.cover}\n                      alt={resourceQuery.data.title}\n                      className=\"border border-gray-300 rounded-lg\"\n                    />\n                  </div>\n                </div>\n              </div>\n            </div>\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 createResource = ({ data }) => {\n  return axios.post(`/resources`, data, {\n    headers: {\n      'Content-Type': 'multipart/form-data',\n    },\n  });\n};\n\ncreateResource.propTypes = {\n  data: PropTypes.shape({\n    title: PropTypes.string.isRequired,\n    price: PropTypes.string,\n    desc: PropTypes.string,\n    curriculum: PropTypes.string.isRequired,\n  }).isRequired,\n};\n\nexport const useCreateResource = ({ config } = {}) => {\n  const { addNotification } = useNotificationStore();\n  return useMutation({\n    onMutate: async (newResource) => {\n      await queryClient.cancelQueries('resources');\n\n      const previousResources = queryClient.getQueryData('resources');\n\n      queryClient.setQueryData('resources', [...(previousResources || []), newResource.data]);\n\n      return { previousResources };\n    },\n    onError: (_, __, context) => {\n      if (context?.previousResources) {\n        queryClient.setQueryData('resources', context.previousResources);\n      }\n    },\n    onSuccess: () => {\n      queryClient.invalidateQueries('resources');\n      addNotification({\n        type: 'success',\n        title: 'Resource Created',\n      });\n    },\n    ...config,\n    mutationFn: createResource,\n  });\n};\n","import { Button, Spinner } from \"components/Elements\";\nimport {\n  DocumentUploadField,\n  Form,\n  FormDrawer,\n  InputField,\n  SelectField,\n  TextAreaField,\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 { useCreateResource } from \"../api/createResource\";\n\nconst schema = z.object({\n  title: z.string().min(1, \"Required\"),\n  resourceType: z.string().min(1, \"Required\"),\n  curriculum: z.string().min(1, \"Required\"),\n  subjectOrCourse: z.string().min(1, \"Required\"),\n  price: z.string(),\n  desc: z.string(),\n});\n\nexport const CreateResource = () => {\n  const [resource, setResource] = useState(null);\n  const [cover, setCover] = useState(null);\n  const [active, setActive] = useState(\"ECCE Curriculum\");\n\n  const curriculumsQuery = [\n    { label: \"ECCE Curriculum\", value: \"ECCE Curriculum\" },\n    { label: \"Primary Curriculum\", value: \"Primary Curriculum\" },\n    { label: \"Secondary Curriculum\", value: \"Secondary Curriculum\" },\n    { label: \"BTVET Curriculum\", value: \"BTVET Curriculum\" },\n    { label: \"Abridged Curriculum\", value: \"Abridged Curriculum\" },\n    {\n      label: \"Accelerated Education Programe\",\n      value: \"Accelerated Education Programe\",\n    },\n  ];\n\n  const resourceTypesQuery = [\n    { label: \"Syllabus Books\", value: \"Syllabus Books\" },\n    {\n      label: \"Textbooks and Teachers Guides\",\n      value: \"Textbooks and Teachers Guides\",\n    },\n    {\n      label: \"Home Study Learning\",\n      value: \"Home Study Learning\",\n    },\n  ];\n\n  const ecceCurriculum = [\n    {\n      label: \"Basic Education Curriculum Framework for Uganda\",\n      value: \"Basic Education Curriculum Framework for Uganda\",\n    },\n    {\n      label: \"Learning Framework for Early Childhood Development (3 - 6 Years)\",\n      value: \"Learning Framework for Early Childhood Development (3 - 6 Years)\",\n    },\n    {\n      label: \"Caregivers Guide to the Learning Framework (3 - 6 Years)\",\n      value: \"Caregivers Guide to the Learning Framework (3 - 6 Years)\",\n    },\n    {\n      label: \"Thematic (Lower Primary) Curriculum\",\n      value: \"Thematic (Lower Primary) Curriculum\",\n    },\n  ];\n\n  const primaryCurriculum = [\n    { label: \"Upper Primary Curriculum\", value: \"Upper Primary Curriculum\" },\n    { label: \"Transition Curriculum\", value: \"Transition Curriculum\" },\n  ];\n\n  const secondaryCurriculum = [\n    {\n      label: \"O Level Curriculum (Revised, Competency-based)\",\n      value: \"O Level Curriculum (Revised, Competency-based)\",\n    },\n    { label: \"A Level Curriculum\", value: \"A Level Curriculum\" },\n  ];\n\n  const btvetCurriculum = [\n    { label: \"Certificate Courses\", value: \"Certificate Courses\" },\n    { label: \"Diploma Programs\", value: \"Diploma Programs\" },\n  ];\n\n  const abridgedCurriculum = [\n    {\n      label: \"Primary 2\",\n      value: \"Primary 2\",\n    },\n    {\n      label: \"Primary 3\",\n      value: \"Primary 3\",\n    },\n    {\n      label: \"Primary 4\",\n      value: \"Primary 4\",\n    },\n    {\n      label: \"Primary 5\",\n      value: \"Primary 5\",\n    },\n    {\n      label: \"Primary 6\",\n      value: \"Primary 6\",\n    },\n    {\n      label: \"Primary 7\",\n      value: \"Primary 7\",\n    },\n    {\n      label: \"Senior 2\",\n      value: \"Senior 2\",\n    },\n    {\n      label: \"Senior 3\",\n      value: \"Senior 3\",\n    },\n    {\n      label: \"Senior 4\",\n      value: \"Senior 4\",\n    },\n    {\n      label: \"Senior 5\",\n      value: \"Senior 5\",\n    },\n    {\n      label: \"Senior 6\",\n      value: \"Senior 6\",\n    },\n  ];\n\n  const acceleratedEducationPrograme = [\n    {\n      label: \"Special Needs Education (SNE)\",\n      value: \"Special Needs Education (SNE)\",\n    },\n    {\n      label: \"Pastoral and fishing communities\",\n      value: \"Pastoral and fishing communities\",\n    },\n    {\n      label: \"Refugees and host communities\",\n      value: \"Refugees and host communities\",\n    },\n  ];\n\n  const createResourceMutation = useCreateResource();\n\n  if (createResourceMutation.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={createResourceMutation.isSuccess}\n        triggerButton={\n          <Button\n            variant=\"create\"\n            size=\"sm\"\n            startIcon={<PlusIcon className=\"h-4 w-4\" />}\n          >\n            Create Resource\n          </Button>\n        }\n        title=\"Create Resource\"\n        submitButton={\n          <Button\n            form=\"create-resource\"\n            type=\"submit\"\n            size=\"sm\"\n            isLoading={createResourceMutation.isLoading}\n          >\n            Submit\n          </Button>\n        }\n      >\n        <Form\n          id=\"create-resource\"\n          encType=\"multipart/form-data\"\n          onSubmit={async (values) => {\n            const {\n              title,\n              price,\n              desc,\n              resourceType,\n              curriculum,\n              subjectOrCourse,\n            } = values;\n            const bodyFormData = new FormData();\n            bodyFormData.append(\"title\", title);\n            bodyFormData.append(\"price\", price);\n            bodyFormData.append(\"desc\", desc);\n            bodyFormData.append(\"resourceType\", resourceType);\n            bodyFormData.append(\"curriculum\", curriculum);\n            bodyFormData.append(\"subjectOrCourse\", subjectOrCourse);\n            bodyFormData.append(\"cover\", cover);\n            bodyFormData.append(\"resource\", resource);\n            await createResourceMutation.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=\"Description\"\n                error={formState.errors[\"desc\"]}\n                editorContent={watch(\"desc\")}\n                setValue={setValue}\n                value=\"desc\"\n              />\n              <InputField\n                label=\"Price\"\n                error={formState.errors[\"price\"]}\n                registration={register(\"price\")}\n              />\n              <DocumentUploadField\n                label=\"Upload Resource Cover Photo\"\n                accept=\"image/*\"\n                error={formState.errors[\"cover\"]}\n                onChange={(e) => {\n                  setCover(e.target.files[0]);\n                }}\n              />\n              <DocumentUploadField\n                label=\"Upload Resource File\"\n                accept=\"application/pdf\"\n                error={formState.errors[\"resource\"]}\n                onChange={(e) => {\n                  setResource(e.target.files[0]);\n                }}\n              />\n              <SelectField\n                label=\"Select Resource Type\"\n                error={formState.errors[\"resourceType\"]}\n                registration={register(\"resourceType\")}\n                options={resourceTypesQuery}\n              />\n              <SelectField\n                label=\"Select Curriculum\"\n                error={formState.errors[\"curriculum\"]}\n                registration={register(\"curriculum\")}\n                options={curriculumsQuery}\n                onChange={(e) => setActive(e.target.value)}\n              />\n              {active === \"ECCE Curriculum\" && (\n                <SelectField\n                  label=\"Select Subject or Course(ECCE)\"\n                  error={formState.errors[\"subjectOrCourse\"]}\n                  registration={register(\"subjectOrCourse\")}\n                  options={ecceCurriculum?.map((curriculum) => ({\n                    label: curriculum.label,\n                    value: curriculum.value,\n                  }))}\n                />\n              )}\n              {active === \"Primary Curriculum\" && (\n                <SelectField\n                  label=\"Select Subject or Course(Primary)\"\n                  error={formState.errors[\"subjectOrCourse\"]}\n                  registration={register(\"subjectOrCourse\")}\n                  options={primaryCurriculum?.map((curriculum) => ({\n                    label: curriculum.label,\n                    value: curriculum.value,\n                  }))}\n                />\n              )}\n              {active === \"Secondary Curriculum\" && (\n                <SelectField\n                  label=\"Select Subject or Course(Secondary)\"\n                  error={formState.errors[\"subjectOrCourse\"]}\n                  registration={register(\"subjectOrCourse\")}\n                  options={secondaryCurriculum?.map((curriculum) => ({\n                    label: curriculum.label,\n                    value: curriculum.value,\n                  }))}\n                />\n              )}\n              {active === \"BTVET Curriculum\" && (\n                <SelectField\n                  label=\"Select Subject or Course(BTVET)\"\n                  error={formState.errors[\"subjectOrCourse\"]}\n                  registration={register(\"subjectOrCourse\")}\n                  options={btvetCurriculum?.map((curriculum) => ({\n                    label: curriculum.label,\n                    value: curriculum.value,\n                  }))}\n                />\n              )}\n              {active === \"Abridged Curriculum\" && (\n                <SelectField\n                  label=\"Select Subject or Course(BTVET)\"\n                  error={formState.errors[\"subjectOrCourse\"]}\n                  registration={register(\"subjectOrCourse\")}\n                  options={abridgedCurriculum?.map((curriculum) => ({\n                    label: curriculum.label,\n                    value: curriculum.value,\n                  }))}\n                />\n              )}\n              {active === \"Accelerated Education Programe\" && (\n                <SelectField\n                  label=\"Select Subject or Course(Accelerated Education Programe)\"\n                  error={formState.errors[\"subjectOrCourse\"]}\n                  registration={register(\"subjectOrCourse\")}\n                  options={acceleratedEducationPrograme?.map((curriculum) => ({\n                    label: curriculum.label,\n                    value: curriculum.value,\n                  }))}\n                />\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 getResources = () => {\n  return axios.get('/resources');\n};\n\nexport const useResources = ({ config } = {}) => {\n  return useQuery({\n    ...config,\n    queryKey: ['resources'],\n    queryFn: () => getResources(),\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 deleteResource = ({ resourceId }) => {\n  return axios.delete(`/resources/${resourceId}`);\n};\n\ndeleteResource.propTypes = {\n  resourceId: PropTypes.string.isRequired,\n};\n\nexport const useDeleteResource = ({ config } = {}) => {\n  const { addNotification } = useNotificationStore();\n\n  return useMutation({\n    onMutate: async (deletedResource) => {\n      await queryClient.cancelQueries('resources');\n\n      const previousResources = queryClient.getQueryData('resources');\n\n      queryClient.setQueryData(\n        'resources',\n        previousResources?.filter((resource) => resource.id !== deletedResource.resourceId)\n      );\n\n      return { previousResources };\n    },\n    onError: (_, __, context) => {\n      if (context?.previousResources) {\n        queryClient.setQueryData('resources', context.previousResources);\n      }\n    },\n    onSuccess: () => {\n      queryClient.invalidateQueries('resources');\n      addNotification({\n        type: 'success',\n        title: 'Resources Deleted',\n      });\n    },\n    ...config,\n    mutationFn: deleteResource,\n  });\n};\n","import { Button, ConfirmationDialog, Spinner } from \"components/Elements\";\nimport { Authorization, ROLES } from \"lib/authorization\";\nimport PropTypes from \"prop-types\";\n\nimport { useDeleteResource } from \"../api/deleteResource\";\n\nexport const DeleteResource = ({ id }) => {\n  const deleteResourceMutation = useDeleteResource();\n\n  if (deleteResourceMutation.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 Resource\"\n\t\t\t\tbody=\"Are you sure you want to delete this Resource?\"\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={deleteResourceMutation.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 deleteResourceMutation.mutateAsync({ resourceId: id })\n\t\t\t\t\t\t}>\n\t\t\t\t\t\tDelete Resource\n\t\t\t\t\t</Button>\n\t\t\t\t}\n\t\t\t/>\n\t\t</Authorization>\n\t);\n};\n\nDeleteResource.propTypes = {\n  id: PropTypes.string.isRequired,\n};\n","import { Table, Spinner, Link } from \"components/Elements\";\nimport { UPLOADS_API_URL } from \"config\";\nimport { LazyLoadImage } from \"react-lazy-load-image-component\";\nimport { formatDate } from \"utils/format\";\n\nimport { useResources } from \"../api/getResources\";\n\nimport { DeleteResource } from \"./DeleteResource\";\n\nexport const ResourcesList = () => {\n  const resourcesQuery = useResources();\n\n  if (resourcesQuery.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 (!resourcesQuery.data) return null;\n\n  return (\n    <Table\n      data={resourcesQuery.data}\n      columns={[\n        {\n          title: \"Listings\",\n          field: \"title\",\n          Cell({ entry: { title, createdAt, cover } }) {\n            return (\n              <div className=\"flex flex-row items-center\">\n                <LazyLoadImage\n                  src={UPLOADS_API_URL + \"/\" + cover}\n                  alt=\"background for post\"\n                  className=\"h-16 rounded-lg mr-4\"\n                />\n                <div className=\"\">\n                  <div className=\"w-[30vw] overflow-hidden\">\n                    <p className=\"break-words\">{title}</p>\n                  </div>\n                  <span className=\"text-xs text-gray-200\">\n                    Added {formatDate(createdAt)}\n                  </span>\n                </div>\n              </div>\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<DeleteResource 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 { CreateResource } from \"../components/CreateResource\";\nimport { ResourcesList } from \"../components/ResourcesList\";\n\nexport const Resources = () => {\n  const routes = [\n    {\n      name: \"Resources\",\n      path: \".\",\n    },\n  ];\n  return (\n    <ContentLayout title=\"Resources\" button={<CreateResource />}>\n      <Breadcrumbs routes={routes} />\n      <div className=\"mt-4\">\n        <ResourcesList />\n      </div>\n    </ContentLayout>\n  );\n};\n","import { Navigate, Route, Routes } from 'react-router-dom';\n\nimport { Resource } from './Resource';\nimport { Resources } from './Resources';\n\nexport const ResourcesRoutes = () => {\n  return (\n    <Routes>\n      <Route path=\"\" element={<Resources />} />\n      <Route path=\":resourceId\" element={<Resource />} />\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","useResource","resourceId","config","useQuery","queryKey","queryFn","axios","getResource","abridgedResource","propTypes","PropTypes","u","m","c","o","L","t","Error","captureStackTrace","M","b","length","join","f","e","l","v","a","i","n","slice","indexOf","splice","r","register","slot","props","p","Provider","value","children","F","x","s","passive","g","P","E","ref","id","onClick","T","ourProps","theirProps","defaultTag","displayName","j","D","q","A","checked","onChange","G","k","R","S","B","setSwitch","h","K","currentTarget","preventDefault","w","key","form","closest","elements","tagName","type","nodeName","click","O","role","tabIndex","labelledby","describedby","onKeyUp","onKeyPress","I","features","W","H","as","hidden","readOnly","y","ue","Object","assign","Group","C","_","switch","focus","preventScroll","Label","Description","U","approveResource","ApproveResource","updateResourceMutation","addNotification","useNotificationStore","useMutation","onMutate","approvingResource","queryClient","previousResource","onError","__","context","onSuccess","data","title","mutationFn","useApproveResource","resourceQuery","useState","approved","enabled","setEnabled","isLoading","allowedRoles","ROLES","mutateAsync","updateResource","price","desc","curriculum","isRequired","schema","z","min","resourceType","subjectOrCourse","curriculumsQuery","label","resourceTypesQuery","ecceCurriculum","primaryCurriculum","secondaryCurriculum","btvetCurriculum","abridgedCurriculum","acceleratedEducationPrograme","UpdateResource","updatingResource","useUpdateResource","active","setActive","isDone","isSuccess","triggerButton","variant","startIcon","PencilIcon","submitButton","onSubmit","values","bodyFormData","FormData","append","console","log","options","defaultValues","formState","watch","setValue","error","errors","registration","editorContent","target","updateResourceAsset","headers","cover","resource","UpdateResourceAsset","setCover","setResource","preview","setPreview","updateResourceAssetMutation","updatingResourceAsset","previousResourceAsset","useUpdateResourceAsset","subTitle","files","URL","createObjectURL","accept","Resource","useParams","Head","button","Breadcrumbs","formatDate","updatedAt","src","UPLOADS_API_URL","alt","createResource","CreateResource","createResourceMutation","newResource","previousResources","useCreateResource","PlusIcon","encType","getResources","deleteResource","DeleteResource","deleteResourceMutation","deletedResource","filter","useDeleteResource","icon","body","confirmButton","ResourcesList","resourcesQuery","useResources","columns","field","Cell","entry","createdAt","LazyLoadImage","_id","Resources","ResourcesRoutes","element","ForwardRef","React","svgRef","strokeWidth","stroke","strokeLinecap","strokeLinejoin"],"sourceRoot":""}