<script setup lang="ts">
import {
    ContextMenu,
    ContextMenuTrigger,
    ContextMenuContent,
    ContextMenuItem,
} from '@/components/ui/context-menu';

const dialog = useCreateDirectoryDialog();

const props = defineProps<{
    class?: string;
}>();
</script>

<template>
    <ContextMenu>
        <ContextMenuTrigger :class="props.class">
            <slot />
        </ContextMenuTrigger>
        <ContextMenuContent>
            <ContextMenuItem @select="dialog.openDialog">
                <Icon name="lucide:folder-plus" />
                Create directory
            </ContextMenuItem>
        </ContextMenuContent>
    </ContextMenu>
</template>
