"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"; // --- 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 isBulk = filesToDiscard && filesToDiscard.length > 1; const displayFile = fileToDiscard ?? (filesToDiscard?.length === 1 ? filesToDiscard[0] : null); const description = isBulk ? `This will permanently discard all changes to ${filesToDiscard.length} files. This action cannot be undone.` : null; return ( Discard changes? {description ?? ( <> This will permanently discard all changes to{" "} {displayFile}. This action cannot be undone. )} Cancel 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) { return ( Amend Commit Message

Edit the message for the most recent commit.