/**
 * WhatsApp Preview Component
 * 
 * Preview of a WhatsApp button as it would appear in chat.
 * Uses the shared WhatsApp 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 { WhatsApp } from '@shared/components/widgets/WhatsApp';
import type { PresetGlobalValues, WhatsAppWidgetSettings } from '../../../types/appearance';
import { getWidgetStrings } from '@shared/utils/widget-strings';

interface WhatsAppPreviewProps {
    globalValues: PresetGlobalValues;
    widgetSettings?: WhatsAppWidgetSettings | null;
    isRTL?: boolean;
    language?: string;
}

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

    return (
        <WhatsApp
            globalValues={globalValues}
            widgetSettings={widgetSettings as any}
            context="preview"
            isRTL={isRTL}
            language={language}
            previewText={ws.whatsappPreviewText}
        />
    );
};

export default WhatsAppPreview;
