dify/web/app/components/plugins/plugin-detail-panel/store.ts
Stephen Zhou a84c2d36a3
style: format with vp fmt (#38803)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-07-12 15:57:46 +00:00

33 lines
796 B
TypeScript

import type {
ParametersSchema,
PluginDeclaration,
PluginDetail,
PluginTriggerSubscriptionConstructor,
} from '../types'
import { create } from 'zustand'
type TriggerDeclarationSummary = {
subscription_schema?: ParametersSchema[]
subscription_constructor?: PluginTriggerSubscriptionConstructor | null
}
export type SimpleDetail = Pick<
PluginDetail,
'plugin_id' | 'name' | 'plugin_unique_identifier' | 'id'
> & {
provider: string
declaration: Partial<Omit<PluginDeclaration, 'trigger'>> & {
trigger?: TriggerDeclarationSummary
}
}
type Shape = {
detail: SimpleDetail | undefined
setDetail: (detail?: SimpleDetail) => void
}
export const usePluginStore = create<Shape>((set) => ({
detail: undefined,
setDetail: (detail?: SimpleDetail) => set({ detail }),
}))