mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-19 21:31:46 +00:00
Merge branch 'test' into dev
This commit is contained in:
@@ -4,9 +4,22 @@ import { addonsApi } from '../api/client'
|
||||
interface Addon {
|
||||
id: string
|
||||
name: string
|
||||
description?: string
|
||||
type: string
|
||||
icon: string
|
||||
enabled: boolean
|
||||
config?: Record<string, unknown>
|
||||
fields?: Array<{
|
||||
key: string
|
||||
label: string
|
||||
input_type: string
|
||||
placeholder?: string | null
|
||||
required: boolean
|
||||
secret: boolean
|
||||
settings_key?: string | null
|
||||
payload_key?: string | null
|
||||
sort_order: number
|
||||
}>
|
||||
}
|
||||
|
||||
interface AddonState {
|
||||
@@ -30,6 +43,9 @@ export const useAddonStore = create<AddonState>((set, get) => ({
|
||||
},
|
||||
|
||||
isEnabled: (id: string) => {
|
||||
if (id === 'memories') {
|
||||
return get().addons.some(a => a.type === 'photo_provider' && a.enabled)
|
||||
}
|
||||
return get().addons.some(a => a.id === id && a.enabled)
|
||||
},
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user