/**
 * YouTube Preview Component
 * 
 * Preview of a YouTube video embed as it would appear in chat.
 * Uses the shared YouTube component for parity with live view.
 * 
 * @since 1.5.0
 * @updated 1.6.0 - Migrated to shared component
 * @updated 1.8.0 - Added language prop for multilingual preview
 */

import React from 'react';
import { YouTube } from '@shared/components/widgets/YouTube';
import type { PresetGlobalValues, YouTubeWidgetSettings } from '../../../types/appearance';
import { getWidgetStrings } from '@shared/utils/widget-strings';

interface YouTubePreviewProps {
    globalValues: PresetGlobalValues;
    widgetSettings?: YouTubeWidgetSettings | null;
    isRTL?: boolean;
    language?: string;
}

export const YouTubePreview: React.FC<YouTubePreviewProps> = ({ 
    globalValues,
    widgetSettings,
    isRTL = true,
    language,
}) => {
    const ws = getWidgetStrings(language);

    return (
        <YouTube
            globalValues={globalValues}
            widgetSettings={widgetSettings as any}
            context="preview"
            isRTL={isRTL}
            language={language}
            previewVideoId="dQw4w9WgXcQ"
            previewTitle={ws.youtubePreviewTitle}
            previewDescription={ws.youtubePreviewDescription}
        />
    );
};

export default YouTubePreview;
