feat: phase 2

Newfound motivation
This commit is contained in:
2025-02-23 05:12:21 +01:00
parent fdf3679fbe
commit a29bce2227
36 changed files with 1367 additions and 615 deletions

View File

@ -2,32 +2,33 @@
import Button from 'primevue/button';
import ToggleSwitch from 'primevue/toggleswitch';
import { open } from '@tauri-apps/plugin-shell';
import InstallButton from './InstallButton.vue';
import ModTitlecard from './ModTitlecard.vue';
import { ModEntry } from '../types';
import { usePkgStore } from '../stores';
import { Package } from '../types';
defineProps({
mod: Object as () => ModEntry,
const store = usePkgStore();
const props = defineProps({
pkg: Object as () => Package,
});
const toggle = (value: boolean) => {
store.toggle(props.pkg, value);
};
</script>
<template>
<div class="flex items-center">
<ModTitlecard showVersion :localIcon="true" :mod="mod" />
<ModTitlecard showVersion :pkg="pkg" />
<ToggleSwitch
class="scale-[1.33] shrink-0"
inputId="switch"
:modelValue="mod?.enabled"
/>
<Button
rounded
disabled
icon="pi pi-trash"
severity="danger"
aria-label="delete"
size="small"
class="ml-5 self-center shrink-0"
style="width: 2rem; height: 2rem"
:disabled="!pkg?.loc"
:modelValue="store.isEnabled(pkg)"
v-on:value-change="toggle"
/>
<InstallButton />
<Button
rounded
icon="pi pi-folder"
@ -36,7 +37,7 @@ defineProps({
size="small"
class="ml-2 shrink-0"
style="width: 2rem; height: 2rem"
v-on:click="open(mod?.path ?? '')"
v-on:click="pkg?.loc && open(pkg.loc.path ?? '')"
/>
<Button
rounded
@ -46,7 +47,7 @@ defineProps({
size="small"
class="ml-2 shrink-0"
style="width: 2rem; height: 2rem"
v-on:click="open(mod?.package_url ?? '')"
v-on:click="pkg?.rmt && open(pkg.rmt.package_url ?? '')"
/>
</div>
</template>