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';
|
|
|
|
|
|
2023-07-10 07:47:03 -05:00
|
|
|
export const Panel: FC<{ children?: ReactNode; }> = findModuleChild((mod) => {
|
|
|
|
|
if (typeof mod !== 'object' || !mod.__esModule) return undefined;
|
|
|
|
|
return mod.Panel;
|
|
|
|
|
})
|
|
|
|
|
|
2022-06-05 15:07:47 +02:00
|
|
|
export interface PanelSectionProps {
|
2022-05-26 10:15:32 +02:00
|
|
|
title?: string;
|
|
|
|
|
spinner?: boolean;
|
2023-02-22 21:56:46 -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 {
|
2023-02-22 21:56:46 -05:00
|
|
|
children?: ReactNode;
|
2022-12-21 10:56:39 -05:00
|
|
|
}
|
2023-02-22 21:56:46 -05:00
|
|
|
// 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>);
|