mirror of
https://github.com/hanzoai/home.git
synced 2026-10-30 18:34:19 +00:00
@hanzo/home. No history, no remote, not on GitHub. Co-authored-by: Hanzo Dev <[email protected]>
103 lines
3.6 KiB
TypeScript
103 lines
3.6 KiB
TypeScript
'use client'
|
|
|
|
import { SoundCloudProvider, SpotifyProvider } from '@hanzo/stats'
|
|
import { config } from '../stats.config'
|
|
|
|
export function MusicTab() {
|
|
const soundcloud = config.music.soundcloud.username
|
|
? new SoundCloudProvider(config.music.soundcloud.username)
|
|
: null
|
|
|
|
const spotify = config.music.spotify.userId
|
|
? new SpotifyProvider(config.music.spotify.userId)
|
|
: null
|
|
|
|
return (
|
|
<>
|
|
{/* SoundCloud */}
|
|
{soundcloud && (
|
|
<section className="stats-section">
|
|
<div className="section-header">
|
|
<h2>🎵 SoundCloud</h2>
|
|
<a href={soundcloud.getProfileUrl()} className="view-all" target="_blank">
|
|
@{config.music.soundcloud.username} →
|
|
</a>
|
|
</div>
|
|
<div className="embed-card">
|
|
<iframe
|
|
src={soundcloud.getLikesEmbedUrl(true)}
|
|
width="100%"
|
|
height="450"
|
|
scrolling="no"
|
|
frameBorder="0"
|
|
allow="autoplay"
|
|
/>
|
|
</div>
|
|
</section>
|
|
)}
|
|
|
|
{/* Spotify */}
|
|
{spotify && (
|
|
<section className="stats-section">
|
|
<div className="section-header">
|
|
<h2>🎧 Spotify</h2>
|
|
<a href={spotify.getProfileUrl()} className="view-all" target="_blank">
|
|
View Profile →
|
|
</a>
|
|
</div>
|
|
<div className="embed-grid">
|
|
<div className="embed-card" style={{ padding: '1.5rem', textAlign: 'center' }}>
|
|
<p style={{ color: 'var(--muted-foreground)', marginBottom: '1rem' }}>
|
|
Listen on Spotify
|
|
</p>
|
|
<a
|
|
href={spotify.getProfileUrl()}
|
|
target="_blank"
|
|
className="spotify-button"
|
|
>
|
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor">
|
|
<path d="M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.659.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z" />
|
|
</svg>
|
|
Follow on Spotify
|
|
</a>
|
|
</div>
|
|
|
|
{/* Playlist embeds */}
|
|
{config.music.spotify.playlists.map(playlistId => (
|
|
<div key={playlistId} className="embed-card">
|
|
<iframe
|
|
src={spotify.getPlaylistEmbedUrl(playlistId)}
|
|
width="100%"
|
|
height="352"
|
|
frameBorder="0"
|
|
allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture"
|
|
loading="lazy"
|
|
/>
|
|
</div>
|
|
))}
|
|
</div>
|
|
</section>
|
|
)}
|
|
|
|
{/* SoundCloud Tracks */}
|
|
{soundcloud && (
|
|
<section className="stats-section">
|
|
<div className="section-header">
|
|
<h2>🎹 My Tracks</h2>
|
|
</div>
|
|
<div className="embed-card">
|
|
<iframe
|
|
src={soundcloud.getTracksEmbedUrl(false)}
|
|
width="100%"
|
|
height="450"
|
|
scrolling="no"
|
|
frameBorder="0"
|
|
allow="autoplay"
|
|
/>
|
|
</div>
|
|
</section>
|
|
)}
|
|
</>
|
|
)
|
|
}
|