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