+
(
-
- {dcdnUser.bio}
-
+ {dcdnUser.bio}
);
const Badges = ({ dcdnUser }: { dcdnUser: DCDNUser }): ReactElement => (
@@ -149,4 +173,84 @@ const Username = ({
);
+const SpotifyActivity = ({ spotify }: { spotify: Spotify }): ReactElement => {
+ const startTimestamp: number = spotify.timestamps.start; // Example start timestamp
+ const endTimestamp: number = spotify.timestamps.end; // Example end timestamp
+ const [songProgress, setSongProgress] = useState
();
+ const songDuration: string = moment(endTimestamp - startTimestamp).format(
+ "m:ss"
+ );
+
+ // Update the song progress every second
+ useEffect(() => {
+ const interval = setInterval(() => {
+ const songProgress: string = moment(
+ Date.now() - startTimestamp
+ ).format("m:ss");
+ setSongProgress(songProgress);
+ }, 1000);
+ return () => clearInterval(interval);
+ }, [startTimestamp]);
+
+ return (
+
+
+ {/* Artwork */}
+
+
+ {/* Track Info */}
+
+
{spotify.song}
+
{spotify.artist}
+
+ {songProgress} / {songDuration}
+
+
+
+
+ {/* Spotify Logo */}
+
+
+ );
+};
+
+const GameActivity = ({ activity }: { activity: Activity }): ReactElement => (
+
+
+ {/* Artwork */}
+
+
+ {/* Activity Info */}
+
+
{activity.name}
+
{activity.details}
+
+ {activity.state}
+
+
+
+
+ {/* Activity Logo */}
+
+
+);
+
export default DiscordStatus;