diff --git a/src/components/molecules/LessonCard.tsx b/src/components/molecules/LessonCard.tsx index 47d8011..3aa5c40 100644 --- a/src/components/molecules/LessonCard.tsx +++ b/src/components/molecules/LessonCard.tsx @@ -17,6 +17,10 @@ export const LessonCard = ({ show, handleClick, }: IProps) => { + const truncateTitle = (title: string, maxLength: number) => { + return title.length > maxLength ? `${title.slice(0, maxLength)}...` : title; + }; + return (
{title}
+{truncateTitle(title, 7)}
# {category}
{date}