@@ -2,12 +2,12 @@ import { useState, useEffect } from "react";
22import { Link } from "react-router-dom" ;
33import PropTypes from "prop-types" ;
44
5- function Card ( { user } ) {
5+ function Card ( { events } ) {
66 const [ truncatedText , setTruncatedText ] = useState ( "" ) ;
77 const maxLength = 25 ; // Maximum number of words
88
99 useEffect ( ( ) => {
10- const text = user . description ;
10+ const text = events . description ;
1111 const words = text . split ( " " ) ;
1212
1313 if ( words . length > maxLength ) {
@@ -20,16 +20,16 @@ function Card({ user }) {
2020 < div className = " shadow-lg bg-zinc-600 rounded-2xl max-w-96 h-[30rem] relative" >
2121 < img
2222 className = "w-mag rounded-se-2xl rounded-ss-2xl"
23- src = { `${ user . image } ` }
24- alt = { user . alt }
23+ src = { `${ events . image } ` }
24+ alt = { events . alt }
2525 />
2626 < div className = "content-box px-4 pt-2" >
27- < p className = "py-1 font-medium text-white break-words" > { user . name } </ p >
28- < p className = "date font-thin py-2 pr-3 text-zinc-400" > { user . date } </ p >
27+ < p className = "py-1 font-medium text-white break-words" > { events . name } </ p >
28+ < p className = "date font-thin py-2 pr-3 text-zinc-400" > { events . date } </ p >
2929 < p className = "description text-white font-light " > { truncatedText } </ p >
3030 </ div >
3131 < Link
32- to = { user . link }
32+ to = { events . link }
3333 className = "absolute bottom-0 left-0 right-0 text-center tracking-widest font-thin drop-shadow-lg text-white py-7 hover:text-red-600"
3434 >
3535 READ MORE
@@ -38,7 +38,7 @@ function Card({ user }) {
3838 ) ;
3939}
4040Card . propTypes = {
41- user : PropTypes . isRequired ,
41+ events : PropTypes . isRequired ,
4242} ;
4343
4444export default Card ;
0 commit comments