"use client"; import { useRef, useEffect, useState } from "react"; import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@kandev/ui/card"; import { ScriptEditor } from "@/components/settings/profile-edit/script-editor"; import type { ScriptPlaceholder } from "@/lib/api/domains/settings-api"; type ScriptCardProps = { title: string; description: string; value: string; onChange: (v: string) => void; height?: string; placeholders: ScriptPlaceholder[]; executorType: string; }; export function ScriptCard({ title, description, value, onChange, height = "300px", placeholders, executorType, }: ScriptCardProps) { const containerRef = useRef(null); const [editorHeight, setEditorHeight] = useState(height); useEffect(() => { const el = containerRef.current; if (!el) return; const observer = new ResizeObserver((entries) => { for (const entry of entries) { setEditorHeight(`${entry.contentRect.height}px`); } }); observer.observe(el); return () => observer.disconnect(); }, []); return ( {title} {description}
); }