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/SummaryTweet.js

36 lines
1.1 KiB
JavaScript
Raw Normal View History

2021-05-18 17:15:53 +00:00
import React from "react"
import SummaryBase from "../base/summary/SummaryBase"
import SummaryLeft from "../base/summary/SummaryLeft"
2021-05-20 10:16:01 +00:00
import { faComment, faLocationArrow, faMapMarkerAlt } from "@fortawesome/free-solid-svg-icons"
2021-05-18 17:15:53 +00:00
import SummaryText from "../base/summary/SummaryText"
import SummaryRight from "../base/summary/SummaryRight"
export default function SummaryTweet({ tweet, ...props }) {
let icon
2021-05-20 09:39:40 +00:00
if(tweet["location"]) {
icon = faMapMarkerAlt
}
else if(tweet["place"]) {
icon = faLocationArrow
2021-05-18 17:15:53 +00:00
}
else {
icon = faComment
}
return (
<SummaryBase {...props}>
<SummaryLeft
icon={icon}
2021-05-20 09:39:40 +00:00
title={`@${tweet["poster"]}`}
subtitle={new Date(tweet["insert_time"]).toLocaleString()}
onClick={() => window.open(`https://twitter.com/${tweet["poster"]}/status/${tweet["snowflake"]}`)}
2021-05-18 17:15:53 +00:00
/>
<SummaryText>
{tweet.content}
</SummaryText>
<SummaryRight/>
</SummaryBase>
)
}