moved UsbConfigState interface to stores

This commit is contained in:
JackTheRooster 2025-02-19 22:26:47 -06:00
parent 33a01abba5
commit b7ba6f7c51
4 changed files with 10 additions and 10 deletions

View File

@ -8,7 +8,7 @@ import { InputFieldWithLabel } from "./InputField";
import { useJsonRpc } from "@/hooks/useJsonRpc";
import { useUsbConfigModalStore } from "@/hooks/stores";
import ExtLink from "@components/ExtLink";
import { UsbConfigState } from "@/utils"
import { UsbConfigState } from "@/hooks/stores"
export default function USBConfigDialog({
open,

View File

@ -26,7 +26,7 @@ import { LocalDevice } from "@routes/devices.$id";
import { useRevalidator } from "react-router-dom";
import { ShieldCheckIcon } from "@heroicons/react/20/solid";
import USBConfigDialog from "@components/USBConfigDialog";
import { UsbConfigState } from "@/utils"
import { UsbConfigState } from "@/hooks/stores"
export function SettingsItem({
title,

View File

@ -538,6 +538,14 @@ interface UsbConfigModalState {
setErrorMessage: (message: string | null) => void;
}
export interface UsbConfigState {
vendor_id: string;
product_id: string;
serial_number: string;
manufacturer: string;
product: string;
}
export const useUsbConfigModalStore = create<UsbConfigModalState>(set => ({
modalView: "updateUsbConfig",
errorMessage: null,

View File

@ -232,11 +232,3 @@ export function isChromeOS() {
/* ChromeOS sets navigator.platform to Linux :/ */
return !!navigator.userAgent.match(" CrOS ");
}
export interface UsbConfigState {
vendor_id: string;
product_id: string;
serial_number: string;
manufacturer: string;
product: string;
}