AppNavigator can now navigate

This commit is contained in:
Kevin FEDYNA
2025-01-15 10:24:39 +01:00
parent eea49969b5
commit 55cf175181
2 changed files with 28 additions and 22 deletions
+5 -16
View File
@@ -3,25 +3,14 @@ export interface AppProperties {
icon: string;
}
type AppNavigatorProps = Record<string | number | symbol, never>;
export default async function AppNavigator(_props: AppNavigatorProps) {
const apps: Record<string, AppProperties> = {};
for await (const appDir of Deno.readDir("../(apps)")) {
try {
const properties: AppProperties = await import(`../(apps)/${appDir.name}/(_props)/props.ts`);
apps[appDir.name] = properties;
}
catch (error) {
console.error(`Couldn't import app "${appDir.name}": ${error}`);
}
}
type AppNavigatorProps = {
apps: Record<string, AppProperties>;
};
export default function AppNavigator(props: AppNavigatorProps) {
return (
<>
<p>{JSON.stringify(apps)}</p>
<p>{JSON.stringify(props.apps)}</p>
</>
);
}