import { t } from '@lingui/macro'; import { getAllThematics } from '@services/graphql/queries'; import { ThematicPreview } from '@ts/types/taxonomies'; import Link from 'next/link'; import useSWR from 'swr'; import styles from './ThematicsList.module.scss'; const ThematicsList = () => { const { data, error } = useSWR('/api/thematics', getAllThematics); if (error) return
{t`Failed to load.`}
; if (!data) return
{t`Loading...`}
; const sortedThematics = [...data].sort((a, b) => a.title.localeCompare(b.title) ); const thematics = sortedThematics.map((thematic) => { return (
  • {thematic.title}
  • ); }); return (

    {t`Thematics`}

    ); }; export default ThematicsList;