<script lang="ts">
    /**
     * ae_comp__journal_entry_ai_tools.svelte
     * Journal-specific wrapper for the generic AE_AITools.
     * Handles layout/positioning and specific save behavior for journal entries.
     */
    import AE_AITools from '$lib/ae_elements/AE_AITools.svelte';

    interface Props {
        content: string;
        summary: string; // Bindable
        on_save: () => void;
        log_lvl?: number;
    }

    let { 
        content, 
        summary = $bindable(), 
        on_save, 
        log_lvl = 0 
    }: Props = $props();
</script>

<div class="journal-entry-ai-tools absolute top-2 right-2 z-10">
    <AE_AITools
        {content}
        bind:summary={summary}
        onSave={(newSummary) => {
            summary = newSummary;
            on_save();
        }}
        {log_lvl}
    />
</div>
