fix: encode uri

This commit is contained in:
Benno Tielen 2025-03-24 09:47:55 +01:00
parent 3f0f0a8994
commit 8589fa7926

View file

@ -1,9 +1,8 @@
import styles from "./styles.module.scss" import styles from "./styles.module.scss"
import { StaticImageData } from 'next/image'
import Link from 'next/link' import Link from 'next/link'
export type ImageCardProps = { export type ImageCardProps = {
src: string | StaticImageData, src: string,
title: string, title: string,
href: string href: string
} }
@ -11,7 +10,7 @@ export type ImageCardProps = {
export const ImageCard = ({src, title, href}: ImageCardProps) => { export const ImageCard = ({src, title, href}: ImageCardProps) => {
return ( return (
<Link href={href}> <Link href={href}>
<div className={styles.container} style={{ backgroundImage: `url(${src})` }}> <div className={styles.container} style={{ backgroundImage: `url(${encodeURI(src)})` }}>
<div className={styles.title}> <div className={styles.title}>
{title} {title}
</div> </div>