1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-22 21:14:18 +00:00
pds-2021-g2-nest/nest_frontend/components/interactive/BoxRepositoryTweets.js
2021-05-20 18:28:08 +02:00

24 lines
680 B
JavaScript

import React, { useContext } from "react"
import BoxFullScrollable from "../base/BoxFullScrollable"
import SummaryTweet from "./SummaryTweet"
import ContextLanguage from "../../contexts/ContextLanguage"
import Empty from "./Empty"
export default function BoxRepositoryTweets({ tweets, ...props }) {
const { strings } = useContext(ContextLanguage)
let content
if(tweets.length === 0) {
content = <Empty/>
}
else {
content = tweets.map(tweet => <SummaryTweet key={tweet["snowflake"]} tweet={tweet}/>)
}
return (
<BoxFullScrollable header={strings.tweets} {...props}>
{content}
</BoxFullScrollable>
)
}