Created
May 29, 2022 03:06
-
-
Save jayhuang75/e03a285341c096845a41dc35321f3095 to your computer and use it in GitHub Desktop.
nextjs-rust-twitter-streaming-twittercard.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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