refactor: reached same app state using vite

This commit is contained in:
2024-01-28 15:56:19 +01:00
parent 9179ab10ac
commit e478837164
27 changed files with 805 additions and 207 deletions

View File

@@ -0,0 +1,16 @@
/* eslint-disable react-refresh/only-export-components */
import { createContext, useContext } from "react";
const TerminalContext = createContext<
{ cols: number; rows: number } | undefined
>(undefined);
export const TerminalContextProvider = TerminalContext.Provider;
export const useTerminal = () => {
const context = useContext(TerminalContext);
if (!context)
throw new Error("useTerminal must be used inside a Terminal component");
return context;
};