"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),t=require("@babel/runtime/helpers/objectWithoutProperties"),r=require("react/jsx-runtime"),i=require("react-virtualized"),l=require("@material-ui/core"),n=require("../OffsetWellsTableHead/OffsetWellsTableHead.module.css.js");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=o(e),c=o(t),s=["title"];function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?u(Object(r),!0).forEach((function(t){a.default(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var f=function(e){var t=e.title,i=c.default(e,s);return r.jsx(l.Tooltip,{placement:"top-end",title:t,children:r.jsx(l.TableSortLabel,d({},i))})};exports.SortableHeaderCell=function(e){var t=e.testId,o=e.columnKey,a=e.label,c=e.columnsWithDict,s=e.sortBy,u=e.sortDirection,d=e.onSort,b=e.labelClassName,p=c.find((function(e){return e.key===o})),j=(null==p?void 0:p.minWidth)||0,O=(null==p?void 0:p.flex)||0;return r.jsx(l.TableCell,{"data-testid":t,className:n.headCell,style:{minWidth:j,flex:O},children:r.jsx("div",{className:n.nameWrapper,children:r.jsx(f,{title:"Sort",active:s===o,direction:s===o&&u===i.SortDirection.DESC?"desc":"asc",classes:{root:b||n.headerLabel},onClick:function(){return d(o)},children:a})})})};
//# sourceMappingURL=SortableHeaderCell.js.map
