"use client"; import { useState } from "react"; import { Button } from "@kandev/ui/button"; import { IconArrowBackUp, IconLoader2 } from "@tabler/icons-react"; interface HunkActionBarProps { changeBlockId: string; onRevert: () => Promise | void; onMouseEnter: () => void; onMouseLeave: () => void; } export function HunkActionBar({ changeBlockId, onRevert, onMouseEnter, onMouseLeave, }: HunkActionBarProps) { const [loading, setLoading] = useState(false); const handleClick = async () => { setLoading(true); try { await onRevert(); // Don't setLoading(false) on success — the diff will re-render // and unmount this component when the git status refreshes } catch { setLoading(false); } }; return (
); }