refactor(widgets): replace beszelSystem option with generic integrationSelect

This commit is contained in:
Thomas Camlong committed 2026-06-16 14:38:25 +02:00
1 parent ea8f07e2bd
commit cbb5e301dc
5 files changed
+62 -33

No files matched your search

+19 -4
View File
@@ -60,6 +60,18 @@ interface DynamicSelectInput extends CommonInput<DynamicSelectOption | null> {
};
}
interface IntegrationSelectInput extends CommonInput<string> {
clearable?: boolean;
searchable?: boolean;
useOptions: (
integrationIds: string[],
) => {
data: { value: string; label: string }[];
isPending: boolean;
isError: boolean;
};
}
interface NumberInput extends CommonInput<number> {
validate: z.ZodNumber;
step?: number;
@@ -175,10 +187,13 @@ const optionsFactory = {
defaultValue: "",
withDescription: true,
}),
beszelSystem: () => ({
type: "beszelSystem" as const,
defaultValue: "",
withDescription: true,
integrationSelect: (input: IntegrationSelectInput) => ({
type: "integrationSelect" as const,
defaultValue: input.defaultValue ?? "",
withDescription: input.withDescription ?? false,
clearable: input.clearable ?? false,
searchable: input.searchable ?? true,
useOptions: input.useOptions,
}),
customWidgetSelect: (input?: CommonInput<string>) => ({
type: "customWidgetSelect" as const,