{"version":3,"file":"getTableItem.mjs","sources":[""],"sourcesContent":["import type { ReactNode } from \"react\";\r\nimport { BlockTableBody } from \"../components/tableBody\";\r\nimport { BlockTableCaption } from \"../components/tableCaption\";\r\nimport { BlockTableFoot } from \"../components/tableFoot\";\r\nimport { BlockTableHead } from \"../components/tableHead\";\r\nimport type { IBlockTableItem } from \"../config/types\";\r\n\r\n/**\r\n * Возвращает компонент таблицы\r\n * @returns\r\n */\r\nexport const getTableItem = ({\n  type = \"tbody\", key, html = \"\", rows = [], extraClasses = {}, extraAttrs = {},\n}: IBlockTableItem): ReactNode => {\n  const computedProps = {\n    html, rows, extraClasses, extraAttrs,\n  };\n  switch (type) {\n    case \"caption\":\n      return <BlockTableCaption key={key} {...computedProps} />;\n    case \"thead\":\n      return <BlockTableHead key={key} {...computedProps} />;\n    case \"tfoot\":\n      return <BlockTableFoot key={key} {...computedProps} />;\n    default:\n      return <BlockTableBody key={key} {...computedProps} />;\n  }\n};\n"],"names":["getTableItem","type","key","html","rows","extraClasses","extraAttrs","computedProps","_jsx","BlockTableCaption","BlockTableHead","BlockTableFoot","BlockTableBody"],"mappings":";;;;GAWO,MAAMA,aAAe,EAC1BC,UAAO,QAASC,QAAKC,UAAO,GAAIC,UAAO,GAAIC,0BAAe,CAAA,EAAIC,sBAAa,CAAA,MAE3E,MAAMC,cAAgB,CACpBJ,UAAMC,UAAMC,0BAAcC,uBAE5B,OAAQL,MACN,IAAK;AACH,OAAOO,IAACC,kBAAiB,IAAeF,eAATL,KACjC,IAAK;AACH,OAAOM,IAACE,eAAc,IAAeH,eAATL,KAC9B,IAAK;AACH,OAAOM,IAACG,eAAc,IAAeJ,eAATL,KAC9B;AACE,OAAOM,IAACI,eAAc,IAAeL,eAATL"}