2025-09-26 21:27:00 -04:00
|
|
|
/**
|
|
|
|
|
* @license
|
|
|
|
|
* Copyright 2025 Google LLC
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import type React from 'react';
|
|
|
|
|
import { Box } from 'ink';
|
|
|
|
|
import { Notifications } from '../components/Notifications.js';
|
|
|
|
|
import { MainContent } from '../components/MainContent.js';
|
|
|
|
|
import { DialogManager } from '../components/DialogManager.js';
|
|
|
|
|
import { Composer } from '../components/Composer.js';
|
|
|
|
|
import { ExitWarning } from '../components/ExitWarning.js';
|
|
|
|
|
import { useUIState } from '../contexts/UIStateContext.js';
|
|
|
|
|
|
2025-09-29 16:22:47 -07:00
|
|
|
export const DefaultAppLayout: React.FC<{ width?: string }> = ({
|
|
|
|
|
width = '90%',
|
|
|
|
|
}) => {
|
2025-09-26 21:27:00 -04:00
|
|
|
const uiState = useUIState();
|
|
|
|
|
|
|
|
|
|
return (
|
2025-09-29 16:22:47 -07:00
|
|
|
<Box flexDirection="column" width={width}>
|
2025-09-26 21:27:00 -04:00
|
|
|
<MainContent />
|
|
|
|
|
|
|
|
|
|
<Box flexDirection="column" ref={uiState.mainControlsRef}>
|
|
|
|
|
<Notifications />
|
|
|
|
|
|
|
|
|
|
{uiState.dialogsVisible ? (
|
2025-09-29 14:19:19 -07:00
|
|
|
<DialogManager
|
|
|
|
|
terminalWidth={uiState.terminalWidth}
|
|
|
|
|
addItem={uiState.historyManager.addItem}
|
|
|
|
|
/>
|
2025-09-26 21:27:00 -04:00
|
|
|
) : (
|
|
|
|
|
<Composer />
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
<ExitWarning />
|
|
|
|
|
</Box>
|
|
|
|
|
</Box>
|
|
|
|
|
);
|
|
|
|
|
};
|