"use client";

import { Sparkles } from "lucide-react";

export function ModeWorkspace({
  children,
  aiPanel,
  aiTitle = "AI 解读",
}: {
  children: React.ReactNode;
  aiPanel: React.ReactNode;
  aiTitle?: string;
}) {
  return (
    <div className="py-6 lg:py-8">
      <div className="mode-workspace-grid grid gap-6 lg:grid-cols-2 lg:items-start lg:gap-8 xl:gap-10">
        <div className="flex flex-col gap-5">{children}</div>
        <aside className="flex min-h-[320px] flex-col lg:sticky lg:top-6 lg:max-h-[calc(100vh-7rem)]">
          <div className="zen-card flex min-h-0 flex-1 flex-col rounded-2xl border border-border/60 bg-card/90 shadow-md backdrop-blur-sm">
            <div className="flex items-center gap-2 border-b border-border/50 px-5 py-4">
              <Sparkles size={18} className="text-primary/80" />
              <h2 className="text-sm font-medium tracking-widest text-muted-foreground">
                {aiTitle}
              </h2>
            </div>
            <div className="flex min-h-0 flex-1 flex-col p-4 sm:p-5">{aiPanel}</div>
          </div>
        </aside>
      </div>
    </div>
  );
}
