mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Display git status indicator
This commit is contained in:
4 files changed
+196
-1
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import { useGitStatus } from '@/hooks/useGitStatus';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
interface GitStatusIndicatorProps {
|
||||
projectId: string | null;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export function GitStatusIndicator({ projectId, className }: GitStatusIndicatorProps) {
|
||||
const { data: gitStatus } = useGitStatus(projectId);
|
||||
|
||||
// Only show the indicator if we're in a git repo and have uncommitted changes
|
||||
if (!gitStatus?.isGitRepo || !gitStatus?.hasUncommittedChanges) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"w-2 h-2 bg-yellow-500 rounded-full animate-pulse",
|
||||
"shadow-sm shadow-yellow-500/50",
|
||||
className
|
||||
)}
|
||||
title={`${gitStatus.changedFiles.length} uncommitted change${gitStatus.changedFiles.length !== 1 ? 's' : ''}`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user