mirror of https://github.com/jetkvm/kvm.git
refactor(ui): Don't fetch KeybardAndMouse Icon on every re-render (#795)
This commit is contained in:
parent
6202e3cafa
commit
8d1a66806c
|
@ -22,14 +22,6 @@ const USBStateMap: Record<USBStates, string> = {
|
||||||
"not attached": "Disconnected",
|
"not attached": "Disconnected",
|
||||||
suspended: "Low power mode",
|
suspended: "Low power mode",
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function USBStateStatus({
|
|
||||||
state,
|
|
||||||
peerConnectionState,
|
|
||||||
}: {
|
|
||||||
state: USBStates;
|
|
||||||
peerConnectionState?: RTCPeerConnectionState | null;
|
|
||||||
}) {
|
|
||||||
const StatusCardProps: StatusProps = {
|
const StatusCardProps: StatusProps = {
|
||||||
configured: {
|
configured: {
|
||||||
icon: ({ className }) => (
|
icon: ({ className }) => (
|
||||||
|
@ -63,6 +55,15 @@ export default function USBStateStatus({
|
||||||
statusIndicatorClassName: "bg-green-500 border-green-600",
|
statusIndicatorClassName: "bg-green-500 border-green-600",
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default function USBStateStatus({
|
||||||
|
state,
|
||||||
|
peerConnectionState,
|
||||||
|
}: {
|
||||||
|
state: USBStates;
|
||||||
|
peerConnectionState?: RTCPeerConnectionState | null;
|
||||||
|
}) {
|
||||||
|
|
||||||
const props = StatusCardProps[state];
|
const props = StatusCardProps[state];
|
||||||
if (!props) {
|
if (!props) {
|
||||||
console.warn("Unsupported USB state: ", state);
|
console.warn("Unsupported USB state: ", state);
|
||||||
|
|
Loading…
Reference in New Issue