landvex: Fixar och tester klara för alla komponenter

- Datafabrik: Dockerfile fix, agentorkestrering fungerar
- Vision: Identify-modell, FAISS, OCR alla testade
- API: Alla 7 integrationstester passerade
- Upplösare: Entitetsupplösning verifierad
This commit is contained in:
Bernt
2026-07-05 06:41:32 +00:00
parent f4f853d94b
commit aee0f09db8
19583 changed files with 1450867 additions and 1153 deletions
+47
View File
@@ -0,0 +1,47 @@
import React from 'react';
var getItem = function getItem(key) {
try {
var itemValue = localStorage.getItem(key);
if (typeof itemValue === 'string') {
return JSON.parse(itemValue);
}
return undefined;
} catch (_unused) {
return undefined;
}
};
export default function useLocalStorage(key, defaultValue) {
var _React$useState = React.useState(),
value = _React$useState[0],
setValue = _React$useState[1];
React.useEffect(function () {
var initialValue = getItem(key);
if (typeof initialValue === 'undefined' || initialValue === null) {
setValue(typeof defaultValue === 'function' ? defaultValue() : defaultValue);
} else {
setValue(initialValue);
}
}, [defaultValue, key]);
var setter = React.useCallback(function (updater) {
setValue(function (old) {
var newVal = updater;
if (typeof updater == 'function') {
newVal = updater(old);
}
try {
localStorage.setItem(key, JSON.stringify(newVal));
} catch (_unused2) {}
return newVal;
});
}, [key]);
return [value, setter];
}