import * as React from 'react'; import Box from '@mui/material/Box'; import Grid from '@mui/material/Grid'; import Typography from '@mui/material/Typography'; import { styled } from '@mui/material/styles'; import NavigateNextRoundedIcon from '@mui/icons-material/NavigateNextRounded'; import { Chip } from '@mui/material'; import Author from './Author'; const StyledTypography = styled(Typography)({ display: '-webkit-box', WebkitBoxOrient: 'vertical', WebkitLineClamp: 2, overflow: 'hidden', textOverflow: 'ellipsis', }); const TitleTypography = styled(Typography)(({ theme }) => ({ position: 'relative', textDecoration: 'none', '&:hover': { cursor: 'pointer' }, '& .arrow': { visibility: 'hidden', position: 'absolute', right: 0, top: '50%', transform: 'translateY(-50%)', }, '&:hover .arrow': { visibility: 'visible', opacity: 0.7, }, '&:focus-visible': { outline: '3px solid', outlineColor: 'hsla(210, 98%, 48%, 0.5)', outlineOffset: '3px', borderRadius: '8px', }, '&::before': { content: '""', position: 'absolute', width: 0, height: '1px', bottom: 0, left: 0, backgroundColor: (theme.vars || theme).palette.text.primary, opacity: 0.3, transition: 'width 0.3s ease, opacity 0.3s ease', }, '&:hover::before': { width: '100%', }, })); export default function MostViewed({ mostViewedNews }) { const [focusedCardIndex, setFocusedCardIndex] = React.useState(null); const handleFocus = (index) => { setFocusedCardIndex(index); }; const handleBlur = () => { setFocusedCardIndex(null); }; return (