mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-02-13 12:44:56 -05:00
24 lines
912 B
TypeScript
24 lines
912 B
TypeScript
import { useAppSelector } from 'app/store/storeHooks';
|
|
import { AdvancedSession } from 'features/controlLayers/components/AdvancedSession/AdvancedSession';
|
|
import { SimpleSession } from 'features/controlLayers/components/SimpleSession/SimpleSession';
|
|
import { selectCanvasSessionId, selectCanvasSessionType } from 'features/controlLayers/store/canvasStagingAreaSlice';
|
|
import { memo } from 'react';
|
|
import type { Equals } from 'tsafe';
|
|
import { assert } from 'tsafe';
|
|
|
|
export const CanvasMainPanelContent = memo(() => {
|
|
const type = useAppSelector(selectCanvasSessionType);
|
|
const id = useAppSelector(selectCanvasSessionId);
|
|
|
|
if (type === 'simple') {
|
|
return <SimpleSession id={id} />;
|
|
}
|
|
|
|
if (type === 'advanced') {
|
|
return <AdvancedSession id={id} />;
|
|
}
|
|
|
|
assert<Equals<never, typeof type>>(false, 'Unexpected session type');
|
|
});
|
|
CanvasMainPanelContent.displayName = 'CanvasMainPanelContent';
|