<script setup lang="ts">
import Button from 'primevue/button';
import { open } from '@tauri-apps/plugin-shell';
import InstallButton from './InstallButton.vue';
import ModTitlecard from './ModTitlecard.vue';
import { Package } from '../types';

defineProps({
    pkg: Object as () => Package,
});
</script>

<template>
    <ModTitlecard :pkg="pkg" showNamespace />
    <InstallButton :pkg="pkg" />
    <Button
        rounded
        icon="pi pi-external-link"
        severity="info"
        aria-label="storepage"
        size="small"
        class="self-center ml-2"
        style="width: 2rem; height: 2rem"
        :disabled="!pkg?.rmt"
        v-on:click="open(pkg?.rmt?.package_url ?? '')"
    />
</template>

<style lang="scss">
@import 'primeicons/primeicons.css';
</style>
