// app/components/admin/sidebar-widget-editors/CustomHtmlWidgetEditor.tsx
'use client';

import { CustomHtmlWidgetProps } from '@/lib/page-builder/container-types';

interface HtmlProps { props: CustomHtmlWidgetProps; onUpdate: (p: CustomHtmlWidgetProps) => void; }

export default function CustomHtmlWidgetEditor({ props, onUpdate }: HtmlProps) {
  return (
    <div className="space-y-4">
      <div>
        <label className="block text-sm font-medium text-gray-700 mb-1">Widget Title (optional)</label>
        <input className="w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500"
          value={props.title ?? ''} onChange={e => onUpdate({ ...props, title: e.target.value })} />
      </div>
      <div>
        <label className="block text-sm font-medium text-gray-700 mb-1">HTML Content</label>
        <textarea
          rows={8}
          className="w-full border border-gray-300 rounded-lg px-3 py-2 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-blue-500"
          value={props.html ?? ''}
          onChange={e => onUpdate({ ...props, html: e.target.value })}
        />
      </div>
    </div>
  );
}
