Files
website/components/list-item-research.tsx
Steffen Illium c049688b29
Some checks failed
Next.js App CI / docker (push) Failing after 1m38s
Image sizes
2025-09-18 09:54:50 +02:00

89 lines
2.8 KiB
TypeScript

"use client";
import { Card, CardTitle } from "@/components/ui/card";
import { cn } from "@/lib/utils";
import { ChevronRightIcon } from "lucide-react";
import Image from "next/image";
import Link from "next/link";
import Markdown from "react-markdown";
// Using the same interface as ResearchCard for data consistency
interface Props {
title: string;
href: string;
description: string;
dates: string;
venue?: string;
tags: readonly string[];
image?: string;
video?: string;
className?: string;
}
export function ResearchListItem({
title,
href,
description,
dates,
venue,
image,
video, // Video is less common in this layout but supported
className,
}: Props) {
return (
<Link href={href} className={cn("cards rounded-xl block no-underline", className)}>
<Card className="group flex flex-col md:flex-row overflow-hidden">
{/* Image Container (Fixed Width) */}
{(image || video) && (
<div className="relative w-full md:w-48 flex-shrink-0 bg-muted/30">
{video ? (
<video
src={video}
autoPlay loop muted playsInline
className="h-full w-full object-cover"
/>
) : (
<Image
src={image!}
alt={title}
width={200}
height={150}
sizes="120px"
className="max-h-30 h-full w-full object-contain p-2"
/>
)}
</div>
)}
{/* Text Content Container (Flexible Width) */}
<div className="flex flex-1 flex-col p-4">
<CardTitle className="mt-1 text-base flex items-center">
<span className="truncate max-w-65">{title}</span>
<ChevronRightIcon
className="size-4 shrink-0 translate-x-0 transform opacity-0 transition-all duration-300 ease-out group-hover:translate-x-1 group-hover:opacity-100"
/>
</CardTitle>
<div className="flex items-center gap-x-2 text-xs text-muted-foreground mt-1">
{venue && <span className="font-semibold text-primary">{venue}</span>}
{venue && <span></span>}
<time>{dates}</time>
</div>
<div className="prose max-w-full text-pretty text-xs font-normal dark:prose-invert mt-2">
<Markdown>{description}</Markdown>
</div>
{/*
<CardContent className="mt-auto flex flex-col px-0 pb-0 pt-4">
<div className="flex flex-row flex-wrap gap-1">
{tags.map((tag) => (
<Badge key={tag} variant="secondary" className="px-2 py-0.5 text-[10px] font-normal">
{tag}
</Badge>
))}
</div>
</CardContent> */}
</div>
</Card>
</Link>
);
}