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.3.1.pre.alpha.PLAY14973742 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.4.0.pre.rc.3 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.4.0.pre.rc.2 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.3.1 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.4.0.pre.rc.1 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.3.0.pre.alpha.revert3654PBNTR479removeextraspacingfromradiochildren3734 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.4.0.pre.rc.0 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.3.0 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.3.0.pre.rc.12 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.3.0.pre.rc.11 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.3.0.pre.rc.10 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.3.0.pre.rc.9 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.3.0.pre.rc.8 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.3.0.pre.rc.7 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.3.0.pre.rc.6 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.3.0.pre.rc.5 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.3.0.pre.rc.4 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.2.1.pre.alpha.20240828cikubedbump3702 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.3.0.pre.rc.3 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-14.2.1.pre.alpha.PBNTR431fixingduplicatingtextareaclassname3689 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx