import { Box, Text, useColorModeValue } from '@chakra-ui/react'; import styled from '@emotion/styled'; import { nanoid } from '@reduxjs/toolkit'; import React from 'react'; import { useDispatch } from 'react-redux'; import { Link } from 'react-router-dom'; import { calcTotalDiscussion } from '../../helper/calculateTotal'; import { titleRoute } from '../../helper/titleRoute'; import { setClickComment } from '../../store/scrollDiscussion'; const HomeRightCard = ({ tagName, topPosts }) => { const dispatch = useDispatch(); const Item = styled(Link)` display: block; padding: 0.5rem 1rem; color: ${useColorModeValue('rgb(64, 64, 64)', 'rgb(212, 212, 212)')}; &:hover { background: ${useColorModeValue('rgb(255 255 255)', 'rgb(23 23 23)')}; p:first-of-type { color: ${useColorModeValue( 'rgb(47, 58, 178)', 'rgb(165, 180, 252)' )}; } } `; const TopPostItem = ({ route, title, commentCount }) => { return ( dispatch(setClickComment(false))}> {title} {commentCount} comments ); }; return ( #{tagName} {topPosts.map((topPost) => ( ))} ); }; export default HomeRightCard;