mirror of
https://github.com/StepanovPlaton/torrent_frontend.git
synced 2026-04-04 04:40:50 +04:00
Add audiobooks
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
import { GameCardType } from "@/entities/game";
|
||||
import { Img } from "@/shared/ui";
|
||||
import Link from "next/link";
|
||||
|
||||
export const GameCard = ({ card }: { card: GameCardType }) => {
|
||||
return (
|
||||
<Link className="group/gamecard cursor-pointer" href={"/games/" + card.id}>
|
||||
{!!card.cover && (
|
||||
<Img
|
||||
src={card.cover}
|
||||
preview={true}
|
||||
className="rounded-lg object-contain"
|
||||
width={1280}
|
||||
height={720}
|
||||
/>
|
||||
)}
|
||||
<div className="flex items-center justify-between pr-2">
|
||||
<h2 className="text-3xl tb:text-xl py-1 group-hover/gamecard:underline underline-offset-1">
|
||||
{card.title}
|
||||
</h2>
|
||||
{card.version && (
|
||||
<span className="text-xs max-w-[30%] text-right line-clamp-2 text-fg4">
|
||||
{card.version}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<p className="text-lg tb:text-sm pr-2 text-justify line-clamp-5 text-fg4">
|
||||
{card.description}
|
||||
</p>
|
||||
</Link>
|
||||
);
|
||||
};
|
||||
@@ -1,3 +0,0 @@
|
||||
import { GameCard } from "./gameCard";
|
||||
|
||||
export { GameCard };
|
||||
3
src/features/itemCard/index.ts
Normal file
3
src/features/itemCard/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { ItemCard } from "./itemCard";
|
||||
|
||||
export { ItemCard };
|
||||
52
src/features/itemCard/itemCard.tsx
Normal file
52
src/features/itemCard/itemCard.tsx
Normal file
@@ -0,0 +1,52 @@
|
||||
import {
|
||||
isAudiobook,
|
||||
isGame,
|
||||
isMovie,
|
||||
ItemCardType,
|
||||
ItemService,
|
||||
} from "@/entities/item";
|
||||
import { Img } from "@/shared/ui";
|
||||
import Link from "next/link";
|
||||
|
||||
export const ItemCard = ({ card }: { card: ItemCardType }) => {
|
||||
return (
|
||||
<Link
|
||||
className="group/itemcard cursor-pointer"
|
||||
href={"/" + ItemService.GetSectionUrlByItemType(card) + "/" + card.id}
|
||||
>
|
||||
{!!card.cover && (
|
||||
<Img
|
||||
src={card.cover}
|
||||
preview={true}
|
||||
className="rounded-lg object-contain"
|
||||
width={1280}
|
||||
height={720}
|
||||
/>
|
||||
)}
|
||||
<div className="flex items-center justify-between pr-2">
|
||||
<h2 className="text-3xl tb:text-xl py-1 group-hover/itemcard:underline underline-offset-1">
|
||||
{card.title}
|
||||
</h2>
|
||||
|
||||
{isGame(card) && card.version && (
|
||||
<span className="text-xs max-w-[30%] text-right line-clamp-2 text-fg4">
|
||||
{card.version}
|
||||
</span>
|
||||
)}
|
||||
{isMovie(card) && card.age && (
|
||||
<span className="text-xs max-w-[30%] text-right line-clamp-2 text-fg4">
|
||||
{card.age}
|
||||
</span>
|
||||
)}
|
||||
{isAudiobook(card) && card.author && (
|
||||
<span className="text-xs max-w-[40%] text-right line-clamp-2 text-fg4">
|
||||
{card.author}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<p className="text-lg tb:text-sm pr-2 text-justify line-clamp-5 text-fg4">
|
||||
{card.description}
|
||||
</p>
|
||||
</Link>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user