gitscope
← marzneshin / v0.1.4 / app/dashboard/src/components/table/sort.tsx
https://dev.kronoz.win/r/marzneshin.git
app/dashboard/src/components/table/sort.tsx · TypeScript
Blame Raw
 1import { SortIcon } from './icons';
 2import { FC } from 'react';
 3
 4type SortType = {
 5  sort: string;
 6  column: string;
 7};
 8
 9export const Sort: FC<SortType> = ({ sort, column }) => {
10  if (sort.includes(column))
11    return (
12      <SortIcon
13        transform={sort.startsWith('-') ? undefined : 'rotate(180deg)'} />
14    );
15  return null;
16};