workspace with decoupled nostr package
This commit is contained in:
16
packages/app/src/Element/AppleMusicEmbed.tsx
Normal file
16
packages/app/src/Element/AppleMusicEmbed.tsx
Normal file
@ -0,0 +1,16 @@
|
||||
const AppleMusicEmbed = ({ link }: { link: string }) => {
|
||||
const convertedUrl = link.replace("music.apple.com", "embed.music.apple.com");
|
||||
const isSongLink = /\?i=\d+$/.test(convertedUrl);
|
||||
|
||||
return (
|
||||
<iframe
|
||||
allow="autoplay *; encrypted-media *; fullscreen *; clipboard-write"
|
||||
frameBorder="0"
|
||||
height={isSongLink ? 175 : 450}
|
||||
style={{ width: "100%", maxWidth: 660, overflow: "hidden", background: "transparent" }}
|
||||
sandbox="allow-forms allow-popups allow-same-origin allow-scripts allow-storage-access-by-user-activation allow-top-navigation-by-user-activation"
|
||||
src={convertedUrl}></iframe>
|
||||
);
|
||||
};
|
||||
|
||||
export default AppleMusicEmbed;
|
Reference in New Issue
Block a user