"use client";
import { useRef } from "react";
import { useTranslation } from "react-i18next";
import {
IconArrowBackUp,
IconDots,
IconLoader2,
IconMinus,
IconPencil,
IconPlus,
} from "@tabler/icons-react";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from "@kandev/ui/dropdown-menu";
import { FileIcon } from "@/components/ui/file-icon";
import { FileStatusIcon } from "@/components/shared/file-status-icon";
import { SymlinkIndicator } from "@/components/shared/symlink-indicator";
import { LineStat } from "@/components/diff-stat";
import type { FileRowProps, FileRowContentProps } from "./changes-panel-file-row";
export function TouchFileRowContent(props: FileRowContentProps) {
const { file, treeMode, indentPx, isPending, folder, name } = props;
return (
<>
>
);
}
function TouchFileRowActions({
file,
isPending,
onStage,
onUnstage,
onEditFile,
onDiscard,
}: FileRowProps) {
const { t } = useTranslation();
const triggerRef = useRef(null);
const StageIcon = file.staged ? IconMinus : IconPlus;
return (
event.stopPropagation()}
>
{file.path}
(file.staged ? onUnstage : onStage)(file.path, file.repositoryName)}
>
{isPending ? : }
{t(file.staged ? "task:unstageFile" : "task:stageFile")}
onEditFile(file.path, file.repositoryName)}
>
{t("common:edit")}
onDiscard(file.path, file.repositoryName, triggerRef.current ?? undefined)
}
>
{t("task:discardChanges2")}
);
}