import Card from '@mui/material/Card'; import CardActions from '@mui/material/CardActions'; import CardHeader from '@mui/material/CardHeader'; import CardMedia from '@mui/material/CardMedia'; import Button from '@mui/material/Button'; import Typography from '@mui/material/Typography'; import Box from '@mui/material/Box'; import { styled } from '@mui/material/styles'; import { Link } from 'react-router-dom'; interface ComponentProps { data: { img: string, title: string, description: string[] }, idx: number; } const StyledTypography = styled(Typography)(({ theme }) => ({ color: theme.palette.text.secondary, textAlign: 'justify', marginBottom: '2px', fontSize: '12px', padding: "5px" })); function SmallCard({ data,idx }: ComponentProps) { // if(reverseModifier){ // [textA,textB] = [textB,textA]; // } let buf = data.description.reduce((acc, val) => acc + " " + val, ""); if (buf.length > 70) { buf = buf.slice(0, 70) + "..."; } const textPart = buf; return ( {textPart} {data.description} ) } export default SmallCard;