From 9538f0214575f5b73a3719760cd62b3a86800341 Mon Sep 17 00:00:00 2001 From: Ninad-S <144244166+Ninad-S@users.noreply.github.com> Date: Tue, 19 Nov 2024 08:47:57 -0600 Subject: [PATCH] Added a new Horizontal card component --- src/components/club/HorizontalClubCard.tsx | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/components/club/HorizontalClubCard.tsx diff --git a/src/components/club/HorizontalClubCard.tsx b/src/components/club/HorizontalClubCard.tsx new file mode 100644 index 0000000..41bfe56 --- /dev/null +++ b/src/components/club/HorizontalClubCard.tsx @@ -0,0 +1,49 @@ +import React from 'react'; +import Image from 'next/image'; +import { type SelectClub as Club } from '@src/server/db/models'; +import { type Session } from 'next-auth'; +import JoinButton from './JoinButton'; +import Link from 'next/link'; + +interface HorizontalClubCardProps { + club: Club; + session: Session | null; +} + +const HorizontalClubCard: React.FC = ({ club, session }) => { + const desc = + club.description.length > 50 + ? club.description.slice(0, 150) + '...' + : club.description; + const name = club.name.length > 20 ? club.name.slice(0, 30) + '...' : club.name; + + return ( +
+
+ {club.name} +
+
+
+

{name}

+
+ + + Learn More + +
+
+

{desc}

+
+
+ ); +}; + +export default HorizontalClubCard; \ No newline at end of file