mirror of
https://gitlab.com/megazordpobeda/DataRush.git
synced 2026-05-23 02:47:10 +00:00
feat: something with something
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
import { Competition, CompetitionStatus } from "@/shared/types";
|
||||
import { cn } from "@/shared/lib/utils";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import {
|
||||
Competition,
|
||||
CompetitionState,
|
||||
CompetitionType,
|
||||
} from "@/shared/types/competition";
|
||||
|
||||
interface CompetitionCardProps {
|
||||
competition: Competition;
|
||||
@@ -16,28 +20,36 @@ export function CompetitionCard({
|
||||
className={cn("aspect-square h-full w-auto overflow-hidden", className)}
|
||||
>
|
||||
<div className="relative h-full overflow-hidden">
|
||||
<img
|
||||
src={competition.imageUrl}
|
||||
alt={competition.name}
|
||||
className="h-full w-full object-cover object-center"
|
||||
/>
|
||||
{competition.image_url && (
|
||||
<img
|
||||
src={competition.image_url}
|
||||
alt={competition.title}
|
||||
className="h-full w-full object-cover object-center"
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<CardContent>
|
||||
<div className="flex flex-col gap-2.5">
|
||||
<div className="text-muted-foreground flex items-center gap-2 *:text-sm *:font-semibold">
|
||||
<span>{competition.isOlympics ? "Олимпиада" : "Тренировка"}</span>
|
||||
{competition.status != CompetitionStatus.NotParticipating && (
|
||||
<span>
|
||||
{competition.type === CompetitionType.COMPETITIVE
|
||||
? "Соревнование"
|
||||
: "Тренировка"}
|
||||
</span>
|
||||
{competition.state != CompetitionState.NOT_STARTED && (
|
||||
<>
|
||||
<span>•</span>
|
||||
<span className="text-primary-foreground">
|
||||
{competition.status}
|
||||
{competition.state === CompetitionState.STARTED
|
||||
? "В прогрессе"
|
||||
: "Завершено"}
|
||||
</span>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
<h3 className="line-clamp-2 text-xl font-semibold">
|
||||
{competition.name}
|
||||
{competition.title}
|
||||
</h3>
|
||||
</div>
|
||||
</CardContent>
|
||||
|
||||
Reference in New Issue
Block a user