import { t } from '@lingui/macro'; import { Dates } from '@ts/types/app'; import { ArticleAuthor } from '@ts/types/articles'; import { ThematicPreview } from '@ts/types/taxonomies'; import Link from 'next/link'; import { useRouter } from 'next/router'; import styles from './PostHeader.module.scss'; const PostHeader = ({ author, dates, intro, title, thematics, }: { author: ArticleAuthor; dates: Dates; intro: string; title: string; thematics: ThematicPreview[]; }) => { const { locale } = useRouter(); const getAuthor = () => { return author.firstName ? `${author.firstName} ${author.lastName}` : author.name; }; const getLocaleDate = (date: string) => { const dateOptions: Intl.DateTimeFormatOptions = { day: 'numeric', month: 'long', year: 'numeric', }; return new Date(date).toLocaleDateString(locale, dateOptions); }; const getThematics = () => { return thematics.map((thematic) => { return (
{thematic.title}
); }); }; return (

{title}

); }; export default PostHeader; lippot.com/commit/src/utils/hooks/use-redirection.tsx?id=ff79add1d59375817a10331a35458cca3c419cfe'>commitdiffstats
path: root/src/utils/hooks/use-redirection.tsx
blob: 5a677e26e57df813b5475bbb3471e355633afca4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31