mirror of
https://github.com/pds-nest/nest.git
synced 2024-11-22 21:14:18 +00:00
19 lines
546 B
JavaScript
19 lines
546 B
JavaScript
|
import React, { useContext, useMemo } from "react"
|
||
|
import BoxWordcloud from "../base/BoxWordcloud"
|
||
|
import ContextLanguage from "../../contexts/ContextLanguage"
|
||
|
import tokenizeTweetWords from "../../utils/tokenizeTweetWords"
|
||
|
|
||
|
|
||
|
export default function BoxVisualizationWordcloud({ tweets = [], ...props }) {
|
||
|
const {strings} = useContext(ContextLanguage)
|
||
|
|
||
|
const words = useMemo(
|
||
|
() => tokenizeTweetWords(tweets),
|
||
|
[tweets]
|
||
|
)
|
||
|
|
||
|
return (
|
||
|
<BoxWordcloud header={strings.wordcloud} words={words} {...props}/>
|
||
|
)
|
||
|
}
|