-
+ {!isLoading && !hasLoadingError && people.length > 0 && (
+
+ )}
-
+ {isLoading &&
}
-
Something went wrong
+ {!isLoading && hasLoadingError && (
+
Something went wrong
+ )}
-
There are no people on the server
+ {!isLoading && !hasLoadingError && people.length === 0 && (
+
+ There are no people on the server
+
+ )}
-
There are no people matching the current search criteria
+ {shouldShowNoMatchingPeople && (
+
There are no people matching the current search criteria
+ )}
-
+ {!isLoading && !hasLoadingError && visiblePeople.length > 0 && (
+
+ )}
diff --git a/src/components/PeopleTable.tsx b/src/components/PeopleTable.tsx
index fdd814b4a..f2c9bdd2f 100644
--- a/src/components/PeopleTable.tsx
+++ b/src/components/PeopleTable.tsx
@@ -1,5 +1,45 @@
/* eslint-disable jsx-a11y/control-has-associated-label */
-export const PeopleTable = () => {
+import { Person } from '../types/Person';
+import { PersonLink } from './PersonLink';
+import { SearchLink } from './SearchLink';
+
+type Props = {
+ people: Person[];
+ selectedSlug?: string;
+ sort: string;
+ order: string;
+};
+
+export const PeopleTable = ({ people, selectedSlug, sort, order }: Props) => {
+ const getSortParams = (field: string) => {
+ if (sort !== field) {
+ return {
+ sort: field,
+ order: null,
+ };
+ }
+
+ if (!order) {
+ return {
+ sort: field,
+ order: 'desc',
+ };
+ }
+
+ return {
+ sort: null,
+ order: null,
+ };
+ };
+
+ const getSortIcon = (field: string) => {
+ if (sort !== field) {
+ return 'fas fa-sort';
+ }
+
+ return order === 'desc' ? 'fas fa-sort-down' : 'fas fa-sort-up';
+ };
+
return (
);
diff --git a/src/components/PersonLink.tsx b/src/components/PersonLink.tsx
new file mode 100644
index 000000000..a2c4c2711
--- /dev/null
+++ b/src/components/PersonLink.tsx
@@ -0,0 +1,23 @@
+import { Link, useSearchParams } from 'react-router-dom';
+
+import { Person } from '../types/Person';
+
+type Props = {
+ person: Person;
+};
+
+export const PersonLink = ({ person }: Props) => {
+ const [searchParams] = useSearchParams();
+
+ return (
+
+ {person.name}
+
+ );
+};
diff --git a/src/pages/HomePage.tsx b/src/pages/HomePage.tsx
new file mode 100644
index 000000000..153c06306
--- /dev/null
+++ b/src/pages/HomePage.tsx
@@ -0,0 +1 @@
+export const HomePage = () =>
Home Page
;
diff --git a/src/pages/NotFoundPage.tsx b/src/pages/NotFoundPage.tsx
new file mode 100644
index 000000000..a7c487626
--- /dev/null
+++ b/src/pages/NotFoundPage.tsx
@@ -0,0 +1 @@
+export const NotFoundPage = () =>
Page not found
;