"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),r=require("@babel/runtime/helpers/toConsumableArray"),t=require("@babel/runtime/helpers/slicedToArray"),n=require("react"),u=require("../constants.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var c=o(e),i=o(r),l=o(t);function a(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function s(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?a(Object(t),!0).forEach((function(r){c.default(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):a(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}exports.useTableColumns=function(e){var r=n.useState(null),t=l.default(r,2),o=t[0],c=t[1];return n.useEffect((function(){if(e){var r=e.length<3?e.length:3,t=u.TableColumns.reduce((function(t,n){return n.type===u.ColumnType.metrics?e.reduce((function(e,t){return[].concat(i.default(e),[s(s({},n),{},{key:t,width:n.width[r]})])}),t):t.concat(s(s({},n),{},{width:n.width[r]}))}),[]);c(t)}}),[e]),o};
