Sha256: 2edcbf82307aa68bf00c0fe8d8e7acfaea929955783646803293d9667ab8ac87

Contents?: true

Size: 825 Bytes

Versions: 238

Compression:

Stored size: 825 Bytes

Contents

import React from "react"
import { Header } from "@tanstack/react-table"

import { GenericObject } from "../../types"

import Icon from "../../pb_icon/_icon"

import { displayIcon } from "../Utilities/IconHelpers"

type SortIconButtonProps = {
  header: Header<GenericObject, unknown>
  sortIcon?: string | string[]
}
export const SortIconButton = ({ header, sortIcon }: SortIconButtonProps) => {

  return (
    <>
      {header.column.getIsSorted() === "desc" ? (
        <div className="sort-button-icon" 
            key={displayIcon(sortIcon)[0]}
        >
          <Icon icon={displayIcon(sortIcon)[0]} />
        </div>
      ) : (
        <div className="sort-button-icon" 
            key={displayIcon(sortIcon)[1]}
        >
          <Icon icon={displayIcon(sortIcon)[1]} />
        </div>
      )}
    </>
  )
}

Version data entries

238 entries across 238 versions & 1 rubygems

Version Path
playbook_ui-14.5.0.pre.rc.2 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.4.0.pre.alpha.PBNTR490multilevelselect3832 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.4.0.pre.alpha.PLAY1546highchartsbump3831 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.4.0.pre.alpha.dependabotnpmandyarntiptapextensionparagraph2723830 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.4.0.pre.alpha.dependabotnpmandyarntiptapextensionlink2723828 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.5.0.pre.rc.1 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.4.0.pre.alpha.pbntr523enablekitsforradiofix3826 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.4.0.pre.alpha.pbntr523enablekitsforradiofix3825 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.4.0.pre.alpha.PLAY1546highchartsbump3822 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.4.0.pre.alpha.PLAY1562highchartsbump3819 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.5.0.pre.rc.0 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.3.2.pre.alpha.pbntr523enablekitsforradiofix3809 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.4.0 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.4.0.pre.rc.16 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.4.0.pre.rc.15 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.4.0.pre.rc.14 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.3.2.pre.alpha.PBNTR417addcolorsupdatedefaultcolor3791 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.4.0.pre.rc.13 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.3.2.pre.alpha.PBNTR515typeaheadmarginbottomredux3785 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.3.2.pre.alpha.revert3614PBNTR455ganttchartPOC3783 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx