(text: string, wordLimit: number)
| 13 | }; |
| 14 | |
| 15 | const truncateDescription = (text: string, wordLimit: number) => { |
| 16 | const words = text.split(" "); |
| 17 | if (words.length > wordLimit) { |
| 18 | return words.slice(0, wordLimit).join(" ") + " ..."; |
| 19 | } |
| 20 | return text; |
| 21 | }; |
| 22 | |
| 23 | export function TrackPreview({ showPreview, setShowPreview, track }: TrackPreviewProps) { |
| 24 | const [isMediumOrLarger, setIsMediumOrLarger] = useState(false); |