Sha256: 2481ef054657122841d24ba2c88ce2b65636cca53da215fe7921fa50567b041f

Contents?: true

Size: 819 Bytes

Versions: 56

Compression:

Stored size: 819 Bytes

Contents

import React from "react"
import Icon from "../../pb_icon/_icon"
import { Header } from "@tanstack/react-table"
import { DataType } from "../Utilities/types"
import { displayIcon } from "../Utilities/IconHelpers"

type SortIconButtonProps = {
  header: Header<DataType, 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

56 entries across 56 versions & 1 rubygems

Version Path
playbook_ui-13.21.0.pre.alpha.PLAY12652489 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-13.21.0.pre.alpha.pbntr220improveexpansionspeed2451 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-13.21.0.pre.alpha.PBNTR224letuserresetrowexpansion2441 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-13.21.0.pre.alpha.PBNTR238DatePickerYearBug2436 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-13.21.0.pre.alpha.pbntr220improveexpansionspeed2431 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-13.21.0.pre.alpha.pbntr220improveexpansionspeed2415 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-13.20.0.pre.alpha.play1247htmloptions2404 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-13.20.0.pre.alpha.play1247htmloptions2403 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-13.20.0.pre.alpha.PLAY12572402 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-13.21.0 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-13.19.0.pre.alpha.PBNTR200addadvancedtablekitdarkmodestyles2346 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-13.19.0.pre.alpha.play1174fixconfimationtoastmobilebug2345 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-13.19.0.pre.alpha.play1174fixconfimationtoastmobilebug2342 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-13.19.0.pre.alpha.play1186collapsiblenaviconcolorbug2321 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-13.19.0.pre.alpha.PBNTR211tablekitsubcomponentsreact2318 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-13.19.0.pre.alpha.play1174fixconfimationtoastmobilebug2306 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-13.19.0.pre.alpha.play1174fixconfimationtoastmobilebug2305 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-13.20.0 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-13.19.0.pre.alpha.play1141iconkitusinglibrary2264 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx
playbook_ui-13.19.0.pre.alpha.PBNTR207tabledivsupport2261 app/pb_kits/playbook/pb_advanced_table/Components/SortIconButton.tsx