mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-24 03:48:48 +02:00
31 lines
885 B
TypeScript
31 lines
885 B
TypeScript
import { ReactNode, FC } from 'react';
|
|
|
|
import { Export, findModuleExport } from '../webpack';
|
|
import { createPropListRegex } from '../utils';
|
|
|
|
export interface SidebarNavigationPage {
|
|
title: ReactNode;
|
|
content: ReactNode;
|
|
icon?: ReactNode;
|
|
visible?: boolean;
|
|
hideTitle?: boolean;
|
|
identifier?: string;
|
|
route?: string;
|
|
link?: string;
|
|
padding?: 'none' | 'compact';
|
|
}
|
|
|
|
export interface SidebarNavigationProps {
|
|
title?: string;
|
|
pages: (SidebarNavigationPage | 'separator')[];
|
|
showTitle?: boolean;
|
|
disableRouteReporting?: boolean;
|
|
page?: string;
|
|
onPageRequested?: (page: string) => void;
|
|
}
|
|
|
|
const sidebarNavigationRegex = createPropListRegex(["pages", "fnSetNavigateToPage", "disableRouteReporting"]);
|
|
export const SidebarNavigation = findModuleExport((e: Export) =>
|
|
e?.toString && sidebarNavigationRegex.test(e.toString()),
|
|
) as FC<SidebarNavigationProps>;
|