initial commit
This commit is contained in:
43
src/components/ModTitlecard.vue
Normal file
43
src/components/ModTitlecard.vue
Normal file
@ -0,0 +1,43 @@
|
||||
<script setup lang="ts">
|
||||
import { convertFileSrc } from '@tauri-apps/api/core';
|
||||
import { ModEntry } from '../types';
|
||||
|
||||
defineProps({
|
||||
mod: Object as () => ModEntry,
|
||||
modelValue: Boolean,
|
||||
localIcon: Boolean,
|
||||
showNamespace: Boolean,
|
||||
showVersion: Boolean,
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<img
|
||||
:src="localIcon ? convertFileSrc(mod?.icon ?? '') : mod?.icon"
|
||||
class="self-center rounded-sm"
|
||||
width="32px"
|
||||
height="32px"
|
||||
/>
|
||||
<label class="m-3 align-middle text grow z-5 h-50px" for="switch">
|
||||
<div>
|
||||
<span class="text-lg">
|
||||
{{ mod?.name ?? 'Untitled' }}
|
||||
</span>
|
||||
<span
|
||||
v-if="showNamespace && mod?.namespace"
|
||||
class="text-sm opacity-75"
|
||||
>
|
||||
by {{ mod.namespace }}
|
||||
</span>
|
||||
<span
|
||||
v-if="showVersion && mod?.version"
|
||||
class="text-sm opacity-75 m-2"
|
||||
>
|
||||
{{ mod.version ?? '?.?.?' }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="text-sm opacity-75">
|
||||
{{ mod?.description ?? 'No description' }}
|
||||
</div>
|
||||
</label>
|
||||
</template>
|
Reference in New Issue
Block a user