feat: initial commit

This commit is contained in:
s.esmaeili
2026-09-09 06:46:27 +03:30
commit 0ed6bed028
214 changed files with 20177 additions and 0 deletions
@@ -0,0 +1,22 @@
// Adapted from legacy henza_pwa/src/Mixins/favorite.ts + the `favorits` slice of
// myDataStore. Legacy persisted favorites server-side via POST /add-to-fav; the
// new API has no favorites endpoint yet, so this is local-only (Pinia state,
// not persisted) until that backend support exists. Flagged — not a silent
// behavior match, a deliberate stand-in.
import { defineStore } from 'pinia'
export const useFavoritesStore = defineStore('favorites', {
state: () => ({
ids: [] as string[],
}),
actions: {
toggle(id: string) {
const index = this.ids.indexOf(id)
if (index === -1) this.ids.push(id)
else this.ids.splice(index, 1)
},
isFavorite(id: string) {
return this.ids.includes(id)
},
},
})