Merge branch 'pr-125'

# Conflicts:
#	client/src/api/client.ts
#	client/src/i18n/translations/ar.ts
#	client/src/i18n/translations/es.ts
#	client/src/i18n/translations/fr.ts
#	client/src/i18n/translations/nl.ts
#	client/src/i18n/translations/ru.ts
#	client/src/i18n/translations/zh.ts
#	client/src/pages/AdminPage.tsx
#	client/src/pages/SettingsPage.tsx
#	server/package.json
#	server/src/db/migrations.ts
#	server/src/index.ts
#	server/src/routes/admin.ts
This commit is contained in:
Maurice
2026-03-30 23:10:34 +02:00
32 changed files with 3504 additions and 55 deletions
+35
View File
@@ -0,0 +1,35 @@
import { create } from 'zustand'
import { addonsApi } from '../api/client'
interface Addon {
id: string
name: string
type: string
icon: string
enabled: boolean
}
interface AddonState {
addons: Addon[]
loaded: boolean
loadAddons: () => Promise<void>
isEnabled: (id: string) => boolean
}
export const useAddonStore = create<AddonState>((set, get) => ({
addons: [],
loaded: false,
loadAddons: async () => {
try {
const data = await addonsApi.enabled()
set({ addons: data.addons || [], loaded: true })
} catch {
set({ loaded: true })
}
},
isEnabled: (id: string) => {
return get().addons.some(a => a.id === id && a.enabled)
},
}))