import { FileText, RefreshCw, SaveIcon, Eye } from "lucide-react"
import { Button } from "@/components/ui/button"
import { PANEL_SETTING } from "@/config/panelSetting"

interface HeaderProps {
  onLoadDefaults: () => void;
  onSave: () => void;
  onPreview: () => void;
  isSaving: boolean;
  isDante?: boolean;
}

export function Header({ onLoadDefaults, onSave, onPreview, isSaving, isDante }: HeaderProps) {
  return (
    <div className="flex items-center justify-between gap-4 bg-card p-5 rounded-lg border shadow-md">
      <div className="flex items-center">
        <FileText className="h-7 w-7 ml-3 text-primary" />
        <h1 className="text-2xl font-bold">مدیریت پرامپت‌ها</h1>
      </div>
      <div className="flex gap-2">
        {PANEL_SETTING.template === "prop_firms" && (
          <Button variant="outline" onClick={onLoadDefaults} className="flex items-center gap-2">
            <RefreshCw size={16} />
            بارگذاری مقادیر پیش‌فرض
          </Button>
        )}
        <Button
          variant="secondary"
          onClick={onSave}
          className="flex items-center gap-2"
          disabled={isSaving}
        >
          <SaveIcon size={16} />
          {isSaving ? "در حال ذخیره..." : "ذخیره اطلاعات"}
        </Button>
        {isDante && (
          <Button onClick={onPreview} className="flex items-center gap-2">
            <Eye size={16} />
            مشاهده کلی
          </Button>
        )}
      </div>
    </div>
  )
}
