2026-04-24 08:38:00 +03:00
|
|
|
import Image from 'next/image';
|
2026-04-23 20:52:43 +03:00
|
|
|
import { cn } from '$shared/lib';
|
2026-04-24 08:38:00 +03:00
|
|
|
import { Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '$shared/ui';
|
2026-04-19 08:37:21 +03:00
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
/**
|
|
|
|
|
* Project name
|
|
|
|
|
*/
|
2026-04-23 20:52:43 +03:00
|
|
|
title: string;
|
2026-04-19 08:37:21 +03:00
|
|
|
/**
|
|
|
|
|
* Year the project was completed
|
|
|
|
|
*/
|
2026-04-23 20:52:43 +03:00
|
|
|
year: string;
|
2026-04-19 08:37:21 +03:00
|
|
|
/**
|
|
|
|
|
* Short project description
|
|
|
|
|
*/
|
2026-04-23 20:52:43 +03:00
|
|
|
description: string;
|
2026-04-19 08:37:21 +03:00
|
|
|
/**
|
|
|
|
|
* Technology or category tags
|
|
|
|
|
*/
|
2026-04-23 20:52:43 +03:00
|
|
|
tags: string[];
|
2026-04-19 08:37:21 +03:00
|
|
|
/**
|
|
|
|
|
* Optional preview image URL
|
|
|
|
|
*/
|
2026-04-23 20:52:43 +03:00
|
|
|
imageUrl?: string;
|
|
|
|
|
};
|
2026-04-19 08:37:21 +03:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Compact project card for grid/list display.
|
|
|
|
|
*/
|
|
|
|
|
export function ProjectCard({ title, year, description, tags, imageUrl }: Props) {
|
|
|
|
|
return (
|
|
|
|
|
<Card
|
|
|
|
|
className={cn(
|
|
|
|
|
'group hover:translate-x-[2px] hover:translate-y-[2px]',
|
2026-05-11 12:59:32 +03:00
|
|
|
'hover:shadow-[10px_10px_0_var(--blue)] transition-all duration-300',
|
2026-04-19 08:37:21 +03:00
|
|
|
)}
|
|
|
|
|
>
|
|
|
|
|
<CardHeader>
|
|
|
|
|
<div className="flex flex-row justify-between items-start mb-3">
|
|
|
|
|
<CardTitle className="flex-1">{title}</CardTitle>
|
2026-05-11 12:59:32 +03:00
|
|
|
<span className="brutal-border px-3 py-1 bg-blue text-cream text-sm">{year}</span>
|
2026-04-19 08:37:21 +03:00
|
|
|
</div>
|
|
|
|
|
<CardDescription>{description}</CardDescription>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
|
|
|
|
|
{imageUrl && (
|
2026-05-11 12:59:32 +03:00
|
|
|
<div className="brutal-border my-6 aspect-video bg-blue overflow-hidden relative">
|
2026-04-24 08:38:00 +03:00
|
|
|
<Image src={imageUrl} alt={title} fill className="object-cover" />
|
2026-04-19 08:37:21 +03:00
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
<CardContent className="flex flex-wrap gap-2">
|
|
|
|
|
{tags.map((tag) => (
|
2026-05-11 12:59:32 +03:00
|
|
|
<span key={tag} className="brutal-border px-3 py-1 bg-cream text-blue text-sm uppercase tracking-wide">
|
2026-04-19 08:37:21 +03:00
|
|
|
{tag}
|
|
|
|
|
</span>
|
|
|
|
|
))}
|
|
|
|
|
</CardContent>
|
|
|
|
|
|
|
|
|
|
<CardFooter>
|
2026-04-23 20:52:43 +03:00
|
|
|
<Button variant="primary" className="w-full">
|
|
|
|
|
View Project
|
|
|
|
|
</Button>
|
2026-04-19 08:37:21 +03:00
|
|
|
</CardFooter>
|
|
|
|
|
</Card>
|
2026-04-23 20:52:43 +03:00
|
|
|
);
|
2026-04-19 08:37:21 +03:00
|
|
|
}
|