mirror of
https://github.com/M4X809/list-of-lp.git
synced 2025-12-25 11:12:48 +00:00
- Added `@tailwindcss/postcss` and `tailwind-merge` to package dependencies for better Tailwind CSS integration. - Updated `tailwindcss` to version 4.1.16. - Enhanced `TrackCard` and `TrackModal` components with new styling and functionality, including support for `lpTV` badges. - Refactored CSS imports and layout structure in `index.css` and `page.tsx` for improved responsiveness and visual appeal. - Updated album data in `list.ts` to reflect accurate track information and descriptions.
125 lines
2.9 KiB
TypeScript
125 lines
2.9 KiB
TypeScript
"use client";
|
|
|
|
import { Card, Group, Text, Badge, Box } from "@mantine/core";
|
|
import { useState } from "react";
|
|
import type { AlbumTheme } from "@/lib/themes";
|
|
import type { Track } from "@/lib/ListTypes";
|
|
import TrackModal from "./TrackModal";
|
|
import { twMerge } from "tailwind-merge";
|
|
|
|
interface TrackCardProps {
|
|
track: Track;
|
|
index: number;
|
|
theme: AlbumTheme;
|
|
}
|
|
|
|
export default function TrackCard({ track, index, theme }: TrackCardProps) {
|
|
const [modalOpened, setModalOpened] = useState(false);
|
|
|
|
return (
|
|
<>
|
|
<Card
|
|
onClick={() => setModalOpened(true)}
|
|
className={twMerge(
|
|
"transition-all duration-300 hover:scale-105 hover:cursor-pointer hover:shadow-lg",
|
|
theme.card.background,
|
|
theme.card.backgroundHover,
|
|
theme.card.border,
|
|
)}
|
|
style={{}}
|
|
>
|
|
<Group justify="space-between" align="center">
|
|
<Group gap="md">
|
|
<Box
|
|
style={{
|
|
minWidth: "40px",
|
|
height: "40px",
|
|
display: "flex",
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
background: theme.primary.DEFAULT,
|
|
borderRadius: "8px",
|
|
fontWeight: 700,
|
|
fontSize: "18px",
|
|
color: theme.text.contrast,
|
|
boxShadow: `0 4px 12px ${theme.primary.DEFAULT}60`,
|
|
}}
|
|
>
|
|
{index + 1}
|
|
</Box>
|
|
<Text size="lg" fw={500} style={{ color: theme.text.primary }}>
|
|
{track.label}
|
|
</Text>
|
|
</Group>
|
|
|
|
<Group gap="md">
|
|
<Group gap="xs">
|
|
{track.studioUrl && (
|
|
<Badge
|
|
size="sm"
|
|
variant="filled"
|
|
style={{
|
|
background: theme.badges.studio,
|
|
color: theme.text.contrast,
|
|
}}
|
|
>
|
|
Studio
|
|
</Badge>
|
|
)}
|
|
{track.emilyLive && (
|
|
<Badge
|
|
size="sm"
|
|
variant="filled"
|
|
style={{
|
|
background: theme.badges.liveEmily,
|
|
color: theme.text.contrast,
|
|
}}
|
|
>
|
|
Emily Live
|
|
</Badge>
|
|
)}
|
|
{track.lpLive && (
|
|
<Badge
|
|
size="sm"
|
|
variant="filled"
|
|
style={{
|
|
background: theme.badges.liveLP,
|
|
color: theme.text.contrast,
|
|
}}
|
|
>
|
|
LP Live
|
|
</Badge>
|
|
)}
|
|
{track.lpTV && (
|
|
<Badge
|
|
size="sm"
|
|
variant="filled"
|
|
style={{
|
|
background: theme.badges.lpTV,
|
|
color: theme.text.contrast,
|
|
}}
|
|
>
|
|
LP TV
|
|
</Badge>
|
|
)}
|
|
</Group>
|
|
<Text
|
|
size="sm"
|
|
fw={500}
|
|
style={{
|
|
color: theme.text.muted,
|
|
fontFamily: "monospace",
|
|
background: theme.background.tertiary,
|
|
padding: "4px 12px",
|
|
borderRadius: "6px",
|
|
}}
|
|
>
|
|
{track.duration}
|
|
</Text>
|
|
</Group>
|
|
</Group>
|
|
</Card>
|
|
<TrackModal opened={modalOpened} onClose={() => setModalOpened(false)} track={track} theme={theme} />
|
|
</>
|
|
);
|
|
}
|