diff --git a/src/App.tsx b/src/App.tsx index ed0179f..d153560 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,6 +1,6 @@ import { useRef, useState } from "react"; import { invoke } from "@tauri-apps/api/core"; -import Enclave from "./app/app"; +import Enclave from "@/app/app"; import { Button } from "@/components/ui/button"; function App() { diff --git a/src/components/SelectView.tsx b/src/components/SelectView.tsx new file mode 100644 index 0000000..157279a --- /dev/null +++ b/src/components/SelectView.tsx @@ -0,0 +1,16 @@ +export type ViewProps = C extends React.ComponentType ? P : never; + +export default function SelectView< + T extends Record>, + K extends keyof T, +>({ + config, + views, +}: { + config: { currentView: K; viewProps: ViewProps }; + views: T; +}) { + const ActiveView = views[config.currentView]; + + return ; +}