"use client"; import { useState } from "react"; import { IconGitCommit, IconLoader2, IconCheck } from "@tabler/icons-react"; import { Button } from "@kandev/ui/button"; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter, DialogClose, } from "@kandev/ui/dialog"; import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from "@kandev/ui/alert-dialog"; import { Label } from "@kandev/ui/label"; import { Input } from "@kandev/ui/input"; import { Textarea } from "@kandev/ui/textarea"; import { RadioGroup, RadioGroupItem } from "@kandev/ui/radio-group"; import { Trans, useTranslation } from "react-i18next"; // --- Discard Confirmation Dialog --- type DiscardDialogProps = { open: boolean; onOpenChange: (open: boolean) => void; fileToDiscard: string | null; filesToDiscard: string[] | null; onConfirm: () => void; }; export function DiscardDialog({ open, onOpenChange, fileToDiscard, filesToDiscard, onConfirm, }: DiscardDialogProps) { const { t } = useTranslation(); const isBulk = filesToDiscard && filesToDiscard.length > 1; const displayFile = fileToDiscard ?? (filesToDiscard?.length === 1 ? filesToDiscard[0] : null); const description = isBulk ? t("task:discardAllChangesToFiles", { count: filesToDiscard.length }) : null; return ( {t("task:discardChanges")} {description ?? ( This will permanently discard all changes to{" "} {displayFile}. This action cannot be undone. )} {t("common:cancel")} {t("task:discard")} ); } // --- Amend Commit Message Dialog --- type AmendDialogProps = { open: boolean; onOpenChange: (open: boolean) => void; amendMessage: string; onAmendMessageChange: (value: string) => void; onAmend: () => void; isLoading: boolean; }; export function AmendDialog({ open, onOpenChange, amendMessage, onAmendMessageChange, onAmend, isLoading, }: AmendDialogProps) { const { t } = useTranslation(); return ( {t("task:amendCommitMessage")}

{t("task:editTheMessageForTheMost")}