"use strict";(globalThis.webpackChunk_kenyaemr_esm_ward_app=globalThis.webpackChunk_kenyaemr_esm_ward_app||[]).push([["8488"],{90523:function(e,t,n){n.r(t),n.d(t,{default:()=>d});var r=n(56717),a=n(10558),o=n(31262),i=n.n(o),l=n(66002),u=n(77765),m=n(92835);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var c="inpatient-dashboard-tabs-slot";let d=function(e){var t=e.patientUuid,n=(0,l.useTranslation)().t,d=(0,a.usePatient)(t),f=d.patient,p=d.isLoading,y=d.error,b=(0,o.useMemo)(function(){return{patientUuid:t,patient:f}},[t,f]),E=(0,a.useAssignedExtensions)(c);(0,a.useRenderableExtensions)(c);var h=(0,o.useMemo)(function(){return((function(e){if(Array.isArray(e))return s(e)})(E)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(E)||function(e,t){if(e){if("string"==typeof e)return s(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}}(E)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).sort(function(e,t){var n,r;return(null!=(n=e.order)?n:1/0)-(null!=(r=t.order)?r:1/0)})},[E]);return p?i().createElement(r.jao,null):y?i().createElement(a.ErrorState,{headerTitle:n("inPatient","In-Patient"),error:y}):i().createElement(r.mh4,null,i().createElement(r.mQc,null,i().createElement(r.tdY,{contained:!0},h.map(function(e){return i().createElement(r.OK9,{key:e.name},(0,u.translateFrom)(e.moduleName,e.meta.title,e.meta.title))})),i().createElement(r.nPR,{"data-extension-slot-name":c,"data-extension-slot-module-name":m.e},h.map(function(e){return i().createElement(r.x45,{key:e.name},i().createElement(u.ComponentContext.Provider,{key:e.id,value:{featureName:e.meta.featureName,moduleName:e.moduleName,extension:{extensionId:e.id,extensionSlotName:c,extensionSlotModuleName:e.moduleName}}},i().createElement(a.Extension,{state:b})))}))))}}}]);