style: auto-fix lint and format
This commit is contained in:
1 parent
cbb5e301dc
commit
c751feedf7
3 files changed
+9
-10
No files matched your search
@@ -8,8 +8,7 @@ import type { CommonWidgetInputProps } from "./common";
|
||||
import { useWidgetInputTranslation } from "./common";
|
||||
import { useFormContext } from "./form";
|
||||
|
||||
const useIntegrationSelectTranslation = () =>
|
||||
useScopedI18n("widget.integrationSelect");
|
||||
const useIntegrationSelectTranslation = () => useScopedI18n("widget.integrationSelect");
|
||||
|
||||
export const WidgetIntegrationSelectInput = ({
|
||||
property,
|
||||
@@ -46,4 +45,4 @@ export const WidgetIntegrationSelectInput = ({
|
||||
{...form.getInputProps(`options.${property}`)}
|
||||
/>
|
||||
);
|
||||
};
|
||||
};
|
||||
@@ -24,13 +24,15 @@ export const { definition, componentLoader } = createWidgetDefinition("beszelSys
|
||||
withDescription: true,
|
||||
clearable: true,
|
||||
useOptions: (integrationIds: string[]) => {
|
||||
const { data = [], isPending, isError } = clientApi.widget.beszel.getSystems.useQuery(
|
||||
const {
|
||||
data = [],
|
||||
isPending,
|
||||
isError,
|
||||
} = clientApi.widget.beszel.getSystems.useQuery(
|
||||
{ integrationIds },
|
||||
{ enabled: integrationIds.length > 0, staleTime: 30_000 },
|
||||
);
|
||||
const selectData = data.flatMap((r) =>
|
||||
r.systems.map((s) => ({ value: s.id, label: s.name })),
|
||||
);
|
||||
const selectData = data.flatMap((r) => r.systems.map((s) => ({ value: s.id, label: s.name })));
|
||||
return { data: selectData, isPending, isError };
|
||||
},
|
||||
}),
|
||||
|
||||
@@ -63,9 +63,7 @@ interface DynamicSelectInput extends CommonInput<DynamicSelectOption | null> {
|
||||
interface IntegrationSelectInput extends CommonInput<string> {
|
||||
clearable?: boolean;
|
||||
searchable?: boolean;
|
||||
useOptions: (
|
||||
integrationIds: string[],
|
||||
) => {
|
||||
useOptions: (integrationIds: string[]) => {
|
||||
data: { value: string; label: string }[];
|
||||
isPending: boolean;
|
||||
isError: boolean;
|
||||
|
||||
Reference in new issue
Block a user