Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save jayhuang75/e03a285341c096845a41dc35321f3095 to your computer and use it in GitHub Desktop.

Select an option

Save jayhuang75/e03a285341c096845a41dc35321f3095 to your computer and use it in GitHub Desktop.
nextjs-rust-twitter-streaming-twittercard.js
export default function TwitterCard({ tweet }) {
return (
<div className="mx-auto rounded-lg bg-white shadow p-5 text-gray-800">
{tweet ? (
<>
{tweet &&
tweet.map((msg) => (
<div key={msg.id}>
<div className="flex-grow pl-3">
<h6 className="font-bold text-md">{msg.user.screen_name}</h6>
</div>
<div className="w-12 text-right">
<i className="mdi mdi-twitter text-blue-400 text-3xl"></i>
</div>
<div className="w-full mb-4">
<p className="text-sm">{msg.text}</p>
</div>
<div className="w-full">
<p className="text-xs text-gray-500 text-right">{msg.user.location}</p>
</div>
</div>
))}
</>
) : (
<p className="text-center mt-4">
No Tweet!
</p>
)}
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment