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-05-18 13:14:40 +03:00
|
|
|
import { Badge, Button, Card, CardSidebar, 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
|
|
|
|
|
|
|
|
/**
|
2026-05-18 13:14:40 +03:00
|
|
|
* Project card with sidebar layout.
|
|
|
|
|
* Sidebar: year badge, stack tags, View Project button.
|
|
|
|
|
* Main: title, optional image, description.
|
2026-04-19 08:37:21 +03:00
|
|
|
*/
|
|
|
|
|
export function ProjectCard({ title, year, description, tags, imageUrl }: Props) {
|
|
|
|
|
return (
|
2026-05-16 19:04:37 +03:00
|
|
|
<Card className={cn('group hover:shadow-brutal-xl transition-shadow duration-300')}>
|
2026-05-18 13:14:40 +03:00
|
|
|
<CardSidebar
|
|
|
|
|
sidebar={
|
|
|
|
|
<div className="flex flex-col gap-4">
|
|
|
|
|
<Badge>{year}</Badge>
|
|
|
|
|
{tags.length > 0 && (
|
|
|
|
|
<div className="flex flex-wrap gap-2">
|
|
|
|
|
{tags.map((tag) => (
|
|
|
|
|
<Badge key={tag} variant="outline" size="xs">
|
|
|
|
|
{tag}
|
|
|
|
|
</Badge>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
<Button variant="primary" className="w-full">
|
|
|
|
|
View Project
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
>
|
|
|
|
|
<div className="flex flex-col gap-4">
|
|
|
|
|
<CardTitle className="font-heading">{title}</CardTitle>
|
|
|
|
|
{imageUrl && (
|
|
|
|
|
<div className="brutal-border aspect-video bg-blue overflow-hidden relative">
|
|
|
|
|
<Image src={imageUrl} alt={title} fill className="object-cover" />
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
<p className="opacity-80">{description}</p>
|
2026-04-19 08:37:21 +03:00
|
|
|
</div>
|
2026-05-18 13:14:40 +03:00
|
|
|
</CardSidebar>
|
2026-04-19 08:37:21 +03:00
|
|
|
</Card>
|
2026-04-23 20:52:43 +03:00
|
|
|
);
|
2026-04-19 08:37:21 +03:00
|
|
|
}
|