Guest User

Untitled

a guest
May 19th, 2024
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.41 KB | None | 0 0
  1. "use client";
  2.  
  3. import type { BotObject } from "@/lib/types/apollo";
  4. import { parseAvatar } from "@/lib/utils";
  5. import Image from "next/image";
  6. import Link from "next/link";
  7. import CertifiedBotBadge from "../modules/bot/badges/certified-badge";
  8. import { IconArrowUp, IconServer } from "@tabler/icons-react";
  9.  
  10. interface BotCardProps extends Partial<BotObject> {}
  11.  
  12. export default function BotReducedCard({
  13. id,
  14. avatar,
  15. name,
  16. shortDescription,
  17. certified,
  18. guildCount,
  19. votes,
  20. }: BotCardProps) {
  21. return (
  22. <Link href={`/bot/${id}`}>
  23. <div className="relative animate-in fade-in slide-in-from-bottom-3 overflow-hidden group bg-card w-full h-full rounded-xl cursor-pointer group duration-150">
  24. <div
  25. draggable={false}
  26. className="animate-in bg-no-repeat group-hover:scale-110 duration-150 bg-cover fade-in absolute w-full h-32 gradient-mask-b-0 opacity-[0.15]"
  27. style={{
  28. backgroundImage: `url('${parseAvatar(avatar, id as string)}')`,
  29. }}
  30. />
  31. <div className="relative z-[2] p-6">
  32. <div className="flex items-center mb-4 gap-4">
  33. <div>
  34. <div className="relative w-16 h-16 rounded-lg overflow-hidden">
  35. <Image
  36. alt="bot avatar"
  37. draggable={false}
  38. src={parseAvatar(avatar, id as string)}
  39. width={64}
  40. height={64}
  41. className="w-full h-full object-cover"
  42. />
  43. </div>
  44. </div>
  45. <div className="w-full">
  46. <div className="flex items-center justify-between w-full">
  47. <div className="flex items-center gap-1">
  48. <h3 className="min-w-min text-card-foreground font-semibold text-lg line-clamp-1">
  49. {name}
  50. </h3>
  51. {certified && <CertifiedBotBadge />}
  52. </div>
  53. </div>
  54. <h4 className="text-muted-foreground text-xs">
  55. Fun, Moderation, Etc.
  56. </h4>
  57. </div>
  58. </div>
  59. <p className="text-secondary-foreground gradient-mask-b-30 text-sm mt-1 line-clamp-4 text-wrap break-words h-20">
  60. {shortDescription}
  61. </p>
  62. <div className="flex justify-between mt-4">
  63. <div className="flex gap-2 items-center">
  64. <IconArrowUp className="w-4 h-4" /> {votes?.totalCount}
  65. </div>
  66. <div className="flex gap-2 items-center">
  67. <IconServer className="w-4 h-4" /> {guildCount}
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </Link>
  73. );
  74. }
  75.  
Advertisement
Add Comment
Please, Sign In to add comment