Files
decky-frontend-lib/src/components/Panel.ts

27 lines
827 B
TypeScript
Raw Normal View History

import { FC, ReactNode } from 'react';
import { Export, findModuleDetailsByExport } from '../webpack';
// TODO where did this go?
// export const Panel: FC<{ children?: ReactNode; }> = findModuleExport((e: Export) => {
// if (typeof mod !== 'object' || !mod.__esModule) return undefined;
// return mod.Panel;
// });
export interface PanelSectionProps {
title?: string;
spinner?: boolean;
children?: ReactNode;
}
const [mod, panelSection] = findModuleDetailsByExport((e: Export) => e.toString()?.includes('.PanelSection'));
export const PanelSection = panelSection as FC<PanelSectionProps>;
export interface PanelSectionRowProps {
children?: ReactNode;
}
2024-05-12 15:48:13 -04:00
export const PanelSectionRow = Object.values(mod).filter(
(exp: any) => !exp?.toString?.()?.includes('.PanelSection'),
2024-05-12 15:48:13 -04:00
)[0] as FC<PanelSectionRowProps>;