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