Files
decky-frontend-lib/src/deck-components/Panel.tsx

29 lines
683 B
TypeScript
Raw Normal View History

2022-12-21 10:56:39 -05:00
import { FC, ReactNode } from 'react';
2022-05-26 10:15:32 +02:00
import { findModuleChild } from '../webpack';
2022-06-05 15:07:47 +02:00
export interface PanelSectionProps {
2022-05-26 10:15:32 +02:00
title?: string;
spinner?: boolean;
2022-12-21 10:56:39 -05:00
children?: ReactNode
2022-05-26 10:15:32 +02:00
}
const [panelSection, mod] = findModuleChild((mod: any) => {
for (let prop in mod) {
if (mod[prop]?.toString()?.includes('.PanelSection')) {
return [mod[prop], mod];
}
}
return null;
});
export const PanelSection = panelSection as FC<PanelSectionProps>;
2022-12-21 10:56:39 -05:00
export interface PanelSectionRowProps {
children?: ReactNode
}
2022-05-26 10:15:32 +02:00
export const PanelSectionRow = Object.values(mod).filter(
(exp: any) => !exp?.toString()?.includes('.PanelSection'),
2022-12-21 10:56:39 -05:00
)[0] as FC<PanelSectionRowProps>;