/** * Status bar: cursor position, language, encoding, indent style, git branch. */ import React from 'react'; import { Tooltip, TooltipContent, TooltipTrigger } from '@renderer/components/ui/tooltip'; import { useStore } from '@renderer/store'; import { GitBranch } from 'lucide-react'; import { useShallow } from 'zustand/react/shallow'; interface EditorStatusBarProps { line: number; col: number; language: string; } export const EditorStatusBar = React.memo(function EditorStatusBar({ line, col, language, }: EditorStatusBarProps): React.ReactElement { const { gitBranch, isGitRepo, watcherEnabled } = useStore( useShallow((s) => ({ gitBranch: s.editorGitBranch, isGitRepo: s.editorIsGitRepo, watcherEnabled: s.editorWatcherEnabled, })) ); const toggleWatcher = useStore((s) => s.toggleWatcher); return (
Ln {line}, Col {col} {isGitRepo && gitBranch && ( {gitBranch} )}
{watcherEnabled ? 'Disable external change watcher' : 'Watch for external changes'} {language} UTF-8 Spaces: 2
); });