fixes & update

Signed-off-by: Hadi <[email protected]>
This commit is contained in:
Hadi
2026-10-04 18:46:49 +02:00
parent 238d764b0a
commit 18668f4aea
80 changed files with 1682 additions and 754 deletions
+26
View File
@@ -0,0 +1,26 @@
// @bun
// src/context/helper.tsx
import { createComponent as _$createComponent } from "@opentui/solid";
import { createContext, useContext } from "solid-js";
function createSimpleContext2(input) {
const ctx = createContext();
return {
provider: (props) => {
const value = input.init(props);
return _$createComponent(ctx.Provider, {
value,
get children() {
return props.children;
}
});
},
use() {
const value = useContext(ctx);
if (!value)
throw new Error(`${input.name} context must be used within its provider`);
return value;
}
};
}
export { createSimpleContext2 };