{"version":3,"file":"WorkspaceLayout.mjs","names":[],"sources":["../../../../../src/plugins/SlotLayout/layout/WorkspaceLayout.tsx"],"sourcesContent":["import React from 'react';\nimport clsx from 'clsx';\nimport { Slot } from './Slot';\nimport { ChatViewEmptyPlaceholder } from '../ChatViewEmptyPlaceholder';\nimport { hasSlotContent } from '../slotRegistry';\n\nimport type { ReactNode } from 'react';\n\nexport type WorkspaceLayoutSlot = {\n  content?: ReactNode;\n  slot: string;\n};\n\nexport type WorkspaceLayoutProps = {\n  navRail?: ReactNode;\n  /**\n   * The slots, each with what it shows. {@link ChatViewEmptyPlaceholder} replaces them while none\n   * has content (`null`, `undefined` and booleans count as none).\n   */\n  slots: WorkspaceLayoutSlot[];\n};\n\nexport const WorkspaceLayout = ({ navRail, slots }: WorkspaceLayoutProps) => {\n  const isEmpty = !slots.some(({ content }) => hasSlotContent(content));\n\n  return (\n    <div className='str-chat__chat-view__workspace-layout'>\n      {navRail ? (\n        <div className='str-chat__chat-view__workspace-layout-nav-rail'>{navRail}</div>\n      ) : null}\n      <div\n        className={clsx('str-chat__chat-view__workspace-layout-slots', {\n          'str-chat__chat-view__workspace-layout-slots--empty': isEmpty,\n        })}\n      >\n        {isEmpty ? (\n          <ChatViewEmptyPlaceholder />\n        ) : (\n          slots.map(({ content, slot }) => (\n            <Slot\n              className='str-chat__chat-view__workspace-layout-slot'\n              key={slot}\n              slot={slot}\n            >\n              {content}\n            </Slot>\n          ))\n        )}\n      </div>\n    </div>\n  );\n};\n"],"mappings":";;;;;;;AAsBA,IAAa,mBAAmB,EAAE,SAAS,YAAkC;CAC3E,MAAM,UAAU,CAAC,MAAM,MAAM,EAAE,cAAc,eAAe,OAAO,CAAC;CAEpE,OACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACG,UACC,oBAAC,OAAD;GAAK,WAAU;aAAkD;EAAa,CAAA,IAC5E,MACJ,oBAAC,OAAD;GACE,WAAW,KAAK,+CAA+C,EAC7D,sDAAsD,QACxD,CAAC;aAEA,UACC,oBAAC,0BAAD,CAA2B,CAAA,IAE3B,MAAM,KAAK,EAAE,SAAS,WACpB,oBAAC,MAAD;IACE,WAAU;IAEJ;cAEL;GACG,GAJC,IAID,CACP;EAEA,CAAA,CACF;;AAET"}