Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions apps/web/components/TrackPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,38 +40,38 @@ export function TrackPreview({ showPreview, setShowPreview, track }: TrackPrevie

return (
<Dialog open={showPreview} onOpenChange={() => setShowPreview(false)}>
<DialogContent className="flex items-center gap-4">
<div className="flex flex-col gap-4 w-full">
<img src={track.image} className="h-[25vh] w-full object-cover rounded-lg" />
<div className="flex flex-col gap-4 bg-primary/5 rounded-lg p-4">
<div className="flex flex-col gap-4">
<h3 className="text-xl md:text-2xl font-semibold w-full tracking-tight">{track.title}</h3>
<DialogContent className="flex items-center gap-2">
<div className="flex flex-col gap-3 w-full">
<img src={track.image} className="h-[20vh] w-full object-cover rounded-lg" />
<div className="flex flex-col gap-2 bg-primary/5 rounded-lg p-4">
<div className="flex flex-col gap-2">
<h3 className="text-xl md:text-xl font-semibold w-full tracking-tight">{track.title}</h3>
<div className="flex items-center gap-4">
{track.categories.map((item: any, idx: number) => (
<p
key={item.category.id}
className="bg-secondary/25 border border-primary/10 rounded-lg px-3 py-2 text-sm w-fit cursor-default"
key={item.category.id}
className="bg-secondary/35 border border-primary/10 rounded-lg px-2 py-1 text-sm w-fit cursor-default"
>
{item.category.category}{" "}
</p>
))}
</div>
</div>
<p className="md:text-lg tracking-tighter line-clamp-3 text-primary/60">{truncatedDescription}</p>
<p className="md:text-base tracking-tighter line-clamp-3 text-primary/60">{truncatedDescription}</p>
</div>
<div className="flex flex-col gap-4 w-full">
<div className="flex gap-2 items-center">
<p className="flex tracking-tighter gap-2 text-primary text-lg md:text-xl font-semibold">
<p className="flex tracking-tighter gap-2 text-primary text-lg md:text-lg font-semibold">
{track.problems.length} Chapters
</p>
<p className="flex tracking-tight gap-2 text-primary/60 md:text-lg">
<p className="flex tracking-tight gap-2 text-primary/60 md:text-sm">
{formatDistanceToNow(new Date(track.createdAt), { addSuffix: true })}
</p>
</div>
<div className="max-h-[25vh] overflow-y-auto flex flex-col gap-3 w-full py-2">
<div className="max-h-[25vh] overflow-y-auto flex flex-col gap-3 w-full py-2 scrollbar-thin">
{track.problems.map((topic: any, idx: number) => (
<Link key={topic.id} href={`/tracks/${track.id}/${track.problems[idx]?.id}`}>
<div className="cursor-pointer hover:-translate-y-1 flex items-center justify-between bg-primary/5 rounded-lg px-4 py-3 hover:bg-primary/10 transition-all duration-300 scroll-smooth w-full">
<div className="cursor-pointer hover:-translate-y-1 flex items-center justify-between bg-primary/5 rounded-lg px-4 py-3 hover:bg-primary/10 transition-all duration-300 scroll-smooth w-[99%]">
{topic.title}
<ArrowRight className="size-4" />
</div>
Expand Down
Loading