2024-02-01 19:59:51 +01:00
|
|
|
import ProjectType from '../../types/project'
|
2023-01-29 04:58:06 +01:00
|
|
|
import ProjectPreview from '../ProjectPreview'
|
2022-11-16 00:14:59 +01:00
|
|
|
import styles from './index.module.css'
|
|
|
|
|
|
|
|
type Props = {
|
2024-02-01 19:59:51 +01:00
|
|
|
projects: Partial<ProjectType>[]
|
2022-11-16 00:14:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export default function Projects({ projects }: Props) {
|
|
|
|
return (
|
2022-11-18 00:46:24 +01:00
|
|
|
<nav className={styles.projects}>
|
2022-11-16 00:14:59 +01:00
|
|
|
{projects.length > 0 &&
|
2022-11-16 22:28:33 +01:00
|
|
|
projects.map((project, i) => (
|
2022-11-16 00:14:59 +01:00
|
|
|
<ProjectPreview
|
|
|
|
key={project.slug}
|
|
|
|
title={project.title}
|
2022-11-16 22:28:33 +01:00
|
|
|
image={project.images[0]}
|
|
|
|
// give priority for the first 2 images
|
|
|
|
imagePriority={i == 0 || i === 1}
|
2022-11-16 00:14:59 +01:00
|
|
|
slug={project.slug}
|
|
|
|
/>
|
|
|
|
))}
|
2022-11-18 00:46:24 +01:00
|
|
|
</nav>
|
2022-11-16 00:14:59 +01:00
|
|
|
)
|
|
|
|
}
|