redesign tabs

This commit is contained in:
isUnknown 2024-09-10 09:12:52 +02:00
parent 893d173c59
commit 0075a37ab2
4 changed files with 52 additions and 38 deletions

View file

@ -1,12 +1,21 @@
import { defineStore } from "pinia";
import { useApiStore } from "./api.js";
import { ref } from "vue";
import { ref, computed } from "vue";
export const useProjectsStore = defineStore("projects", () => {
const projects = ref([]);
const api = useApiStore();
api.fetchPageData("projects").then((json) => (projects.value = json));
const currentProjects = computed(() => {
return projects.value.filter((project) => project.status === "listed");
});
const archivedProjects = computed(() => {
return projects.value.filter((project) => project.status === "unlisted");
});
return { projects };
const api = useApiStore();
api
.fetchPageData("projects")
.then((json) => (projects.value = json.children));
return { projects, currentProjects, archivedProjects };
});