// frontend/src/components/Preview/PreviewPanel.jsx
import React from 'react';
import ModernTemplate from './templates/ModernTemplate';
import ClassicTemplate from './templates/ClassicTemplate';
import MinimalTemplate from './templates/MinimalTemplate';

const PreviewPanel = ({ data, template }) => {
  const templates = {
    modern: ModernTemplate,
    classic: ClassicTemplate,
    minimal: MinimalTemplate
  };
  
  const TemplateComponent = templates[template] || ModernTemplate;
  
  return (
    <div className="w-1/2 bg-gray-100 overflow-y-auto p-6">
      <div className="max-w-4xl mx-auto">
        <div className="bg-white shadow-xl rounded-lg overflow-hidden">
          <TemplateComponent data={data} />
        </div>
      </div>
    </div>
  );
};

export default PreviewPanel;