UNPKG

@payfit/unity-components

Version:

26 lines (25 loc) 948 B
import { Actionable as e } from "../../actionable/Actionable.js"; import { Icon as t } from "../../icon/Icon.js"; import "react"; import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime"; //#region src/components/data-table/parts/ColumnSortHeader.tsx function a({ children: a, header: o, ...s }) { return /* @__PURE__ */ r(e, { ...s, className: "uy:flex uy:items-center uy:gap-50", onPress: () => { o.column.getCanSort() && o.column.toggleSorting(); }, children: ({ isHovered: e }) => /* @__PURE__ */ i(n, { children: [a, o.column.getCanSort() && (o.column.getIsSorted() || e) ? /* @__PURE__ */ r(t, { src: o.column.getIsSorted() === "asc" ? "ArrowUpOutlined" : "ArrowDownOutlined", role: "presentation", size: 20 }) : /* @__PURE__ */ r("span", { "aria-hidden": "true", className: "uy:size-250 uy:block" })] }) }); } a.displayName = "ColumnSortHeader"; //#endregion export { a as ColumnSortHeader };