gameflow-deck/src/mainview/routes/settings/interface.tsx
Simeon Radivoev 38cb752552
feat: Implemented public plugin system accessible from the store.
feat: Implemented external ryujinx integration plugin
refactor: moved sdk types and schemas to own workspace package
fix: Fixed emulator launch with no game
2026-05-10 02:21:01 +03:00

36 lines
1.5 KiB
TypeScript

import { LocalOption } from '@/mainview/components/options/LocalOption';
import { settingRegistry } from '@simeonradivoev/gameflow-sdk/shared';
import { LocalSettingsSchema } from '@simeonradivoev/gameflow-sdk/shared';
import { FocusContext, useFocusable } from '@noriginmedia/norigin-spatial-navigation';
import { createFileRoute } from '@tanstack/react-router';
import { Terminal } from 'lucide-react';
import { zodValidator } from '@tanstack/zod-adapter';
import z from 'zod';
export const Route = createFileRoute('/settings/interface')({
component: RouteComponent,
validateSearch: zodValidator(z.object({ focus: z.string().optional() }))
});
function RouteComponent ()
{
const { focus } = Route.useSearch();
const { ref, focusKey } = useFocusable({
focusKey: "interface-settings",
preferredChildFocusKey: focus
});
return <ul ref={ref} className="list rounded-box gap-2">
<FocusContext value={focusKey}>
{Object.keys(LocalSettingsSchema.shape)
.filter(k => !settingRegistry.get(LocalSettingsSchema.shape[k as keyof typeof LocalSettingsSchema.shape])?.dev)
.map(k => <LocalOption id={k as any} />)}
{import.meta.env.DEV && <>
<div className="divider">Dev Settings<Terminal /></div>
{Object.keys(LocalSettingsSchema.shape)
.filter(k => settingRegistry.get(LocalSettingsSchema.shape[k as keyof typeof LocalSettingsSchema.shape])?.dev)
.map(k => <LocalOption id={k as any} />)}
</>}
</FocusContext>
</ul>;
}