Refactor types in svelte components.

This commit is contained in:
vorotamoroz
2026-06-01 11:18:23 +01:00
parent c6697327d5
commit cd2bff5fc7
19 changed files with 268 additions and 170 deletions
@@ -7,16 +7,19 @@
import Options from "@/lib/src/UI/components/Options.svelte";
import Instruction from "@/lib/src/UI/components/Instruction.svelte";
import UserDecisions from "@/lib/src/UI/components/UserDecisions.svelte";
const TYPE_USE_SETUP_URI = "use-setup-uri";
const TYPE_SCAN_QR_CODE = "scan-qr-code";
const TYPE_CONFIGURE_MANUALLY = "configure-manually";
const TYPE_CANCELLED = "cancelled";
type ResultType = typeof TYPE_USE_SETUP_URI | typeof TYPE_SCAN_QR_CODE | typeof TYPE_CONFIGURE_MANUALLY | typeof TYPE_CANCELLED;
import {
TYPE_USE_SETUP_URI,
TYPE_SCAN_QR_CODE,
TYPE_CONFIGURE_MANUALLY,
TYPE_CANCELLED,
type SelectMethodExistingResultType,
} from "./setupDialogTypes";
type Props = {
setResult: (result: ResultType) => void;
setResult: (result: SelectMethodExistingResultType) => void;
};
const { setResult }: Props = $props();
let userType = $state<ResultType>(TYPE_CANCELLED);
let userType = $state<SelectMethodExistingResultType>(TYPE_CANCELLED);
let proceedTitle = $derived.by(() => {
if (userType === TYPE_USE_SETUP_URI) {
return "Proceed with Setup URI";