Skip to content
Discussion options

You must be logged in to vote

SOLVED IT WITH THE CODE BELOW

'use client'

import { useState } from 'react';
import styles from '../styles/Home_Page/styles.module.css';

import Link from 'next/link'

const LikeComponent = ({ id, slug, links, image }) => {
  const [liked, setLiked] = useState(() => "");

  const likeMe = () => {
    liked !== `${styles.heartClicked}` ? setLiked(`${styles.heartClicked}`) : setLiked("")
  };


  return (
    <div className={styles.mainItems} key={id}>
      <div className={styles.imgContainer}>
      <Link href={`/similar/${slug}`}>
          <img className={styles.mainImage} src={`http://localhost:3000/${image}`} alt={`Product ${id}`} />
        </Link>
      </div>
      <div className=…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by firaki12345-cmd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant