import { deriveToolCallSummary } from "../../utils/toolCall";
import styles from "./ToolCallBlock.module.css";

interface ToolCallBlockProps {
	content: string;
}

export function ToolCallBlock({ content }: ToolCallBlockProps) {
	return (
		<details className={styles.collapsible}>
			<summary className={styles.summary}>
				<span className={styles.summaryText}>{deriveToolCallSummary(content)}</span>
			</summary>
			<div className={styles.detail}>
				<pre className={styles.detailPre}>{content}</pre>
			</div>
		</details>
	);
}
