- 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.
29 lines
935 B
TypeScript
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} />;
|
|
};
|