fix Analyse
This commit is contained in:
@@ -53,18 +53,10 @@ export default function RecipeDetail() {
|
||||
let videoId = null;
|
||||
let embedUrl = null;
|
||||
if (sourceUrl) {
|
||||
if (sourceType === 'instagram') {
|
||||
const igMatch = sourceUrl.match(/instagram\.com\/(?:p|reel)\/([A-Za-z0-9_-]+)/);
|
||||
if (igMatch) {
|
||||
videoId = igMatch[1];
|
||||
embedUrl = `https://www.instagram.com/reel/${videoId}/embed/`;
|
||||
}
|
||||
} else {
|
||||
const ttMatch = sourceUrl.match(/video\/(\d+)/);
|
||||
if (ttMatch) {
|
||||
videoId = ttMatch[1];
|
||||
embedUrl = `https://www.tiktok.com/embed/v2/${videoId}`;
|
||||
}
|
||||
const ttMatch = sourceUrl.match(/video\/(\d+)/);
|
||||
if (ttMatch) {
|
||||
videoId = ttMatch[1];
|
||||
embedUrl = `https://www.tiktok.com/embed/v2/${videoId}`;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +70,7 @@ export default function RecipeDetail() {
|
||||
|
||||
<div className="bg-white rounded-xl shadow-sm border border-gray-200 overflow-hidden">
|
||||
{embedUrl && (
|
||||
<div className="w-full" style={{ paddingBottom: sourceType === 'instagram' ? '100%' : '177.78%', position: 'relative' }}>
|
||||
<div className="w-full" style={{ paddingBottom: '177.78%', position: 'relative' }}>
|
||||
<iframe
|
||||
src={embedUrl}
|
||||
className="absolute inset-0 w-full h-full"
|
||||
@@ -153,7 +145,7 @@ export default function RecipeDetail() {
|
||||
|
||||
{author && (
|
||||
<p className="text-xs text-gray-400">
|
||||
Quelle: @{author} ({sourceType === 'instagram' ? 'Instagram' : 'TikTok'})
|
||||
Quelle: @{author} (TikTok)
|
||||
</p>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user