'use client'

import { BannerConfig, BannerTexts, CookieCategory } from '../_hooks/useCookieBanner'

export function BannerPreview({
  config,
  categories,
  bannerTexts,
}: {
  config: BannerConfig
  categories: CookieCategory[]
  bannerTexts: BannerTexts
}) {
  return (
    <div className="relative bg-gray-100 rounded-xl p-8 min-h-64 flex items-end justify-center">
      <div className="absolute inset-0 flex items-center justify-center text-gray-400 text-sm">
        Website-Vorschau
      </div>
      <div
        className={`w-full max-w-2xl bg-white rounded-xl shadow-xl p-6 border-2 ${
          config.position === 'center' ? 'absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2' : ''
        }`}
        style={{ borderColor: config.primaryColor }}
      >
        <h4 className="font-semibold text-gray-900">{bannerTexts.title}</h4>
        <p className="text-sm text-gray-600 mt-2">
          {bannerTexts.description}
        </p>
        <div className="mt-4 flex items-center gap-3">
          <button
            className="px-4 py-2 rounded-lg text-white text-sm font-medium"
            style={{ backgroundColor: config.primaryColor }}
          >
            Alle akzeptieren
          </button>
          {config.showDeclineAll && (
            <button className="px-4 py-2 rounded-lg border border-gray-300 text-gray-700 text-sm font-medium">
              Alle ablehnen
            </button>
          )}
          {config.showSettings && (
            <button className="px-4 py-2 text-sm text-gray-600 hover:underline">
              Einstellungen
            </button>
          )}
        </div>
      </div>
    </div>
  )
}
