agent-ecosystem/src/renderer/components/team/editor/EditorBinaryState.tsx
iliya 52ef9fd0a8 feat: add FAQ section to README and improve cross-platform handling in code
- Introduced a comprehensive FAQ section in the README to address common user queries regarding app installation, code handling, agent communication, and project management.
- Enhanced cross-platform keyboard shortcut handling in the Electron app for better user experience on macOS and Windows/Linux.
- Updated signal handling in the standalone process to ensure proper shutdown behavior across platforms.
- Improved WSL user resolution logic to support default user retrieval for better compatibility.
- Enhanced notification handling to support cross-platform features and improve user feedback.
- Refactored SSH connection management to include additional key file types and improve authentication handling.
- Updated team management services to ensure consistent process termination across platforms.
- Improved project path handling in team provisioning to accommodate different operating systems.
- Enhanced editor components to utilize shared utility functions for path management, improving code maintainability.
2026-03-02 22:56:56 +02:00

29 lines
935 B
TypeScript

/**
* Router for binary file display — picks the right preview component
* based on file type from the preview registry.
*/
import { getPreviewType, isPreviewable } from '@renderer/utils/previewRegistry';
import { getBasename } from '@shared/utils/platformPath';
import { EditorBinaryPlaceholder } from './EditorBinaryPlaceholder';
import { EditorImagePreview } from './EditorImagePreview';
interface EditorBinaryStateProps {
filePath: string;
size: number;
}
export const EditorBinaryState = ({
filePath,
size,
}: EditorBinaryStateProps): React.ReactElement => {
const fileName = getBasename(filePath) || filePath;
const previewType = getPreviewType(fileName);
if (previewType === 'image' && isPreviewable(fileName, size)) {
return <EditorImagePreview filePath={filePath} fileName={fileName} size={size} />;
}
return <EditorBinaryPlaceholder filePath={filePath} fileName={fileName} size={size} />;
};