2023-02-01 22:34:39 +00:00
|
|
|
const SpotifyEmbed = ({ link }: { link: string }) => {
|
2023-02-09 12:26:54 +00:00
|
|
|
const convertedUrl = link.replace(/\/(track|album|playlist|episode)\/([a-zA-Z0-9]+)/, "/embed/$1/$2");
|
2023-02-01 22:34:39 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<iframe
|
|
|
|
style={{ borderRadius: 12 }}
|
|
|
|
src={convertedUrl}
|
|
|
|
width="100%"
|
|
|
|
height="352"
|
|
|
|
frameBorder="0"
|
|
|
|
allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture"
|
2023-02-09 12:26:54 +00:00
|
|
|
loading="lazy"></iframe>
|
2023-02-01 22:34:39 +00:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default SpotifyEmbed;
|