18 lines
		
	
	
		
			405 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			405 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { extractYoutubeId } from "@lib/string.ts";
 | |
| 
 | |
| export const YoutubePlayer = ({ link }: { link: string }) => {
 | |
|   const id = extractYoutubeId(link);
 | |
|   return (
 | |
|     <iframe
 | |
|       class="mb-6"
 | |
|       width="100%"
 | |
|       height="400px"
 | |
|       src={`https://www.youtube-nocookie.com/embed/${id}`}
 | |
|       frameBorder="0"
 | |
|       allow="autoplay; encrypted-media"
 | |
|       allowFullScreen
 | |
|     >
 | |
|     </iframe>
 | |
|   );
 | |
| };
 |