Sha256: 95c1ea11bdea6f163fd4d711a1e83eb15e21f2b7f353ceacc54cf4c55c014350
Contents?: true
Size: 1.43 KB
Versions: 353
Compression:
Stored size: 1.43 KB
Contents
import React from "react" import { Header } from "@tanstack/react-table" import { GenericObject } from "../../types" import Icon from "../../pb_icon/_icon" import { getAllIcons } from "../../utilities/icons/allicons" import { displayIcon } from "../Utilities/IconHelpers" type SortIconButtonProps = { header: Header<GenericObject, unknown> sortIcon?: string | string[] } export const SortIconButton = ({ header, sortIcon }: SortIconButtonProps) => { const firstIcon = displayIcon(sortIcon)[0] const secondIcon = displayIcon(sortIcon)[1] const upIcon = getAllIcons()["arrowUpShortWide"].icon as unknown as { [key: string]: SVGElement } const downIcon = getAllIcons()["arrowDownShortWide"].icon as unknown as { [key: string]: SVGElement } return ( <> {header.column.getIsSorted() === "desc" ? ( <div className="sort-button-icon" key={firstIcon} > { firstIcon === "arrow-up-short-wide" ? ( <Icon className="svg-inline--fa" customIcon={upIcon} /> ) : ( <Icon icon={firstIcon} /> )} </div> ) : ( <div className="sort-button-icon" key={secondIcon} > { secondIcon === "arrow-down-short-wide" ? ( <Icon className="svg-inline--fa" customIcon={downIcon} /> ) : ( <Icon icon={secondIcon} /> )} </div> )} </> ) }
Version data entries
353 entries across 353 versions & 1 rubygems