6e419f815d
- Unify modal/dialog system; .modal-* are now aliases of .dialog-* - Migrate WorkspacesPage, start-tool-modal, merge-dialog, workspace-tools-panel to .dialog-* - Add .card-sm/.card-md/.card-lg/.card-elevated/.card-borderless modifiers - Apply card utilities across workspaces, projects, ssh-keys, workspace-detail, git-history - Remove duplicated card-like background/border/padding from page CSS - Remove 860px breakpoint; standardize on 767px/768px mobile split - Add docs/development/ui-review-checklist.md - Archive web-ui-spacing-typography-rework OpenSpec change
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
/** Git tab for the workspace detail page. */
|
|
|
|
import { useWorkspaceGit } from "../../../hooks/use-workspace-git";
|
|
|
|
interface WorkspaceGitPanelProps {
|
|
workspaceId: string;
|
|
}
|
|
|
|
export function WorkspaceGitPanel({ workspaceId }: WorkspaceGitPanelProps) {
|
|
const { history, branches, currentBranch, checkout, loading, error } =
|
|
useWorkspaceGit(workspaceId);
|
|
|
|
return (
|
|
<div className="git-tab">
|
|
<div className="git-tab-header">
|
|
<select
|
|
value={currentBranch}
|
|
onChange={(e) => checkout(e.target.value)}
|
|
>
|
|
{branches.map((b) => (
|
|
<option key={b} value={b}>
|
|
{b}
|
|
</option>
|
|
))}
|
|
</select>
|
|
</div>
|
|
{loading && <p className="muted">Loading history...</p>}
|
|
{error && <p className="error-text">{error}</p>}
|
|
<div className="commit-history">
|
|
{history.map((commit) => (
|
|
<div key={commit.hash} className="card card-sm commit-row">
|
|
<span className="commit-hash">{commit.hash.slice(0, 7)}</span>
|
|
<span className="commit-message">{commit.message}</span>
|
|
<span className="commit-author">{commit.author}</span>
|
|
<span className="commit-date">{commit.date}</span>
|
|
</div>
|
|
))}
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|