MCPcopy Create free account
hub / github.com/code100x/daily-code / truncateDescription

Function truncateDescription

apps/web/components/TrackPreview.tsx:15–21  ·  view source on GitHub ↗
(text: string, wordLimit: number)

Source from the content-addressed store, hash-verified

13};
14
15const 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
23export function TrackPreview({ showPreview, setShowPreview, track }: TrackPreviewProps) {
24 const [isMediumOrLarger, setIsMediumOrLarger] = useState(false);

Callers 1

TrackPreviewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected