From bb0b203275fdc482c6415112df4593bb518864d2 Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Tue, 18 Aug 2026 10:06:18 +0200 Subject: [PATCH] SelectView --- src/App.tsx | 2 +- src/components/SelectView.tsx | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 src/components/SelectView.tsx 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 ; +}