Add types

This commit is contained in:
Nicola Benaglia 2025-05-30 09:22:07 +02:00
parent be5c3af318
commit 1f5a604932
2 changed files with 50 additions and 33 deletions

View File

@ -7,7 +7,14 @@ import { useQortalMessageListener } from '../../hooks/useQortalMessageListener';
import { useThemeContext } from '../Theme/ThemeContext'; import { useThemeContext } from '../Theme/ThemeContext';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
export const AppViewer = forwardRef( type AppViewerProps = {
app: any;
hide: boolean;
isDevMode: boolean;
skipAuth?: boolean;
};
export const AppViewer = forwardRef<HTMLIFrameElement, AppViewerProps>(
({ app, hide, isDevMode, skipAuth }, iframeRef) => { ({ app, hide, isDevMode, skipAuth }, iframeRef) => {
const { window: frameWindow } = useFrame(); const { window: frameWindow } = useFrame();
const { path, history, changeCurrentIndex, resetHistory } = const { path, history, changeCurrentIndex, resetHistory } =

View File

@ -2,8 +2,19 @@ import { forwardRef } from 'react';
import { AppViewer } from './AppViewer'; import { AppViewer } from './AppViewer';
import Frame from 'react-frame-component'; import Frame from 'react-frame-component';
const AppViewerContainer = forwardRef( type AppViewerContainerProps = {
({ app, isSelected, hide, isDevMode, customHeight, skipAuth }, ref) => { app: any; // Replace `any` with the correct type of `tab` if available
isSelected: boolean;
hide: boolean;
isDevMode: boolean;
customHeight?: string;
skipAuth?: boolean;
};
const AppViewerContainer = forwardRef<
HTMLIFrameElement,
AppViewerContainerProps
>(({ app, isSelected, hide, isDevMode, customHeight, skipAuth }, ref) => {
return ( return (
<Frame <Frame
id={`browser-iframe-${app?.tabId}`} id={`browser-iframe-${app?.tabId}`}
@ -48,7 +59,6 @@ const AppViewerContainer = forwardRef(
/> />
</Frame> </Frame>
); );
} });
);
export default AppViewerContainer; export default AppViewerContainer;