Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 2894 | Rev 2896 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 2894 Rev 2895
Línea 1... Línea 1...
1
import React, { useState, useCallback } from 'react'
1
import React, { useState, useCallback, useMemo } from 'react'
2
import { Typography } from '@mui/material'
2
import { Typography } from '@mui/material'
Línea 3... Línea 3...
3
 
3
 
Línea 4... Línea 4...
4
import { parse } from '@utils'
4
import { parse } from '@utils'
5
 
5
 
6
export default function FeedDescription({ description = '' }) {
6
export default function FeedDescription({ description = '' }) {
Línea 7... Línea 7...
7
  const [showMore, setShowMore] = useState(false)
7
  const [showMore, setShowMore] = useState(false)
8
  const maxLength = 300
8
  const maxLength = 300
9
 
9
 
Línea 10... Línea 10...
10
  const parsedText = useCallback(parse(description ?? ''), [description])
10
  const parsedText = useMemo(parse(description ?? ''), [description])
11
  const truncatedText = parsedText.slice(0, maxLength)
11
  const truncatedText = parsedText.slice(0, maxLength)