diff --git a/front/src/pages/people/People.tsx b/front/src/pages/people/People.tsx index 219c9efd60..f689bfc644 100644 --- a/front/src/pages/people/People.tsx +++ b/front/src/pages/people/People.tsx @@ -1,14 +1,9 @@ -import { - faUser, - faList, - faCalendar, - faEnvelope, -} from '@fortawesome/pro-regular-svg-icons'; +import { faUser, faList } from '@fortawesome/pro-regular-svg-icons'; import WithTopBarContainer from '../../layout/containers/WithTopBarContainer'; import Table from '../../components/table/Table'; import styled from '@emotion/styled'; -import { peopleColumns } from './people-table'; -import { GraphqlPerson, mapPerson } from '../../interfaces/person.interface'; +import { peopleColumns, sortsAvailable } from './people-table'; +import { mapPerson } from '../../interfaces/person.interface'; import { useCallback, useState } from 'react'; import { SortType } from '../../components/table/table-header/SortAndFilterBar'; import { OrderBy, usePeopleQuery } from '../../services/people'; @@ -32,21 +27,6 @@ const reduceSortsToOrderBy = (sorts: Array): OrderBy[] => { return [mappedSorts]; }; -const sortsAvailable = [ - { - id: 'created_at', - label: 'Created at', - order: 'asc', - icon: faCalendar, - }, - { - id: 'email', - label: 'Email', - order: 'asc', - icon: faEnvelope, - }, -] satisfies Array>; - function People() { const [, setSorts] = useState([] as Array); const [orderBy, setOrderBy] = useState(defaultOrderBy); diff --git a/front/src/pages/people/people-table.tsx b/front/src/pages/people/people-table.tsx index f96ef1cbe2..b2264ed452 100644 --- a/front/src/pages/people/people-table.tsx +++ b/front/src/pages/people/people-table.tsx @@ -15,8 +15,24 @@ import Checkbox from '../../components/form/Checkbox'; import HorizontalyAlignedContainer from '../../layout/containers/HorizontalyAlignedContainer'; import CompanyChip from '../../components/chips/CompanyChip'; import PersonChip from '../../components/chips/PersonChip'; -import { Person } from '../../interfaces/person.interface'; +import { GraphqlPerson, Person } from '../../interfaces/person.interface'; import PipeChip from '../../components/chips/PipeChip'; +import { SortType } from '../../components/table/table-header/SortAndFilterBar'; + +export const sortsAvailable = [ + { + id: 'created_at', + label: 'Created at', + order: 'asc', + icon: faCalendar, + }, + { + id: 'email', + label: 'Email', + order: 'asc', + icon: faEnvelope, + }, +] satisfies Array>; const columnHelper = createColumnHelper(); export const peopleColumns = [