-
Notifications
You must be signed in to change notification settings - Fork 189
/
Copy pathnode--article--card-alt.tsx
51 lines (47 loc) · 1.35 KB
/
node--article--card-alt.tsx
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import Link from "next/link"
import { DrupalNode } from "next-drupal"
import { useTranslation } from "next-i18next"
import classNames from "classnames"
import { MediaImage } from "components/media--image"
interface NodeArticleCardAltProps extends React.HTMLProps<HTMLElement> {
node: DrupalNode
}
export function NodeArticleCardAlt({
node,
className,
...props
}: NodeArticleCardAltProps) {
const { t } = useTranslation()
return (
<article
className={classNames(
"relative flex flex-col p-4 space-y-4 overflow-hidden bg-white border border-border group",
className
)}
{...props}
>
<div className="flex flex-col flex-1 space-y-4">
<h2 className="flex-1 font-serif text-2xl">{node.title}</h2>
<Link
href={node.path.alias}
passHref
className="inline-flex items-center uppercase hover:underline text-link"
>
{t("view-article")}
<svg
className="w-5 h-5 ml-1"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
>
<path d="m9 18 6-6-6-6" />
</svg>
</Link>
</div>
<MediaImage media={node.field_media_image} width={335} height={225} />
</article>
)
}