mirror of
https://github.com/SteamDeckHomebrew/decky-frontend-lib.git
synced 2026-05-20 10:00:08 +02:00
29 lines
745 B
TypeScript
29 lines
745 B
TypeScript
import { FC, ReactNode } from 'react';
|
|
|
|
import { findModuleChild } from '../webpack';
|
|
|
|
export interface PanelSectionProps {
|
|
title?: string;
|
|
spinner?: boolean;
|
|
children?: ReactNode;
|
|
}
|
|
|
|
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>;
|
|
|
|
export interface PanelSectionRowProps {
|
|
children?: ReactNode;
|
|
}
|
|
// New as of Feb 22 2023 Beta || Old
|
|
export const PanelSectionRow =
|
|
mod.PanelSectionRow ||
|
|
(Object.values(mod).filter((exp: any) => !exp?.toString()?.includes('.PanelSection'))[0] as FC<PanelSectionRowProps>);
|