-
Notifications
You must be signed in to change notification settings - Fork 190
/
Copy pathnode--recipe--card.tsx
41 lines (37 loc) · 1.1 KB
/
node--recipe--card.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
import { DrupalNode } from "next-drupal"
import { useTranslation } from "next-i18next"
import Link from "next/link"
import { MediaImage } from "components/media--image"
interface NodeRecipeCardProps {
node: DrupalNode
}
export function NodeRecipeCard({ node, ...props }: NodeRecipeCardProps) {
const { t } = useTranslation()
return (
<article
className="relative flex flex-col p-4 space-y-4 overflow-hidden bg-white border border-border group"
{...props}
>
<h2 className="flex-1 font-serif text-[22px]">{node.title}</h2>
<Link
href={node.path.alias}
passHref
className="inline-flex items-center uppercase hover:underline text-link"
>
{t("view-recipe")}
<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>
<MediaImage media={node.field_media_image} width={335} height={225} />
</article>
)
}