<script setup lang="ts">
import type { FileType } from '~/types';

const route = useRoute();

const { name, entryType, disabled } = defineProps<{
    name: string;
    entryType: FileType;
	disabled: boolean,
}>();

const iconName = entryType === 'file' ? 'lucide:file' : 'lucide:folder';
</script>

<template>
    <NuxtLink
        :to="joinPaths(route.path, name)"
        :class="['select-none', { 'pointer-events-none': disabled }]"
    >
        <Button
            class="w-44 h-12"
            variant="outline"
            size="lg"
            :disabled="disabled"
        >
            <Icon :name="iconName" />
            <span class="truncate">{{ name }}</span>
        </Button>
    </NuxtLink>
</template>
