diff --git a/packages/fakeyou.com/src/v2/view/_common/TextExpander.tsx b/packages/fakeyou.com/src/v2/view/_common/TextExpander.tsx index 746e248611..b5469be940 100644 --- a/packages/fakeyou.com/src/v2/view/_common/TextExpander.tsx +++ b/packages/fakeyou.com/src/v2/view/_common/TextExpander.tsx @@ -2,17 +2,18 @@ import React, { useState } from "react"; interface Props { text: string; + cutLength: number; } -export const TextExpander: React.FC = ({ text }) => { +export const TextExpander: React.FC = ({ text, cutLength }) => { const [expanded, setExpanded] = useState(false); - const shortText = text.slice(0, 250); + const shortText = text.slice(0, cutLength); return ( <> - {expanded || text.length <= 250 ? text : shortText + "..."} - {text.length > 250 && ( + {expanded || text.length <= cutLength ? text : shortText + "..."} + {text.length > cutLength && (