feat: add account merging functionality with dialog support; update bulk actions to include merge option
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 1m39s
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 1m39s
This commit is contained in:
@@ -2,29 +2,35 @@
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Card, CardContent } from "@/components/ui/card";
|
||||
import { Trash2 } from "lucide-react";
|
||||
import { Trash2, GitMerge } from "lucide-react";
|
||||
import { useIsMobile } from "@/hooks/use-mobile";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
interface AccountBulkActionsProps {
|
||||
selectedCount: number;
|
||||
selectedAccountIds: string[];
|
||||
onDelete: () => void;
|
||||
onMerge?: () => void;
|
||||
}
|
||||
|
||||
export function AccountBulkActions({
|
||||
selectedCount,
|
||||
selectedAccountIds: _selectedAccountIds,
|
||||
onDelete,
|
||||
onMerge,
|
||||
}: AccountBulkActionsProps) {
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
if (selectedCount === 0) return null;
|
||||
|
||||
const canMerge = selectedCount === 2 && onMerge;
|
||||
|
||||
return (
|
||||
<Card className="bg-destructive/5 border-destructive/20 sticky top-0 z-10 mb-4">
|
||||
<CardContent className={cn("py-3", isMobile && "px-3")}>
|
||||
<div
|
||||
className={cn(
|
||||
"flex items-center gap-2 sm:gap-4",
|
||||
"flex items-center gap-2 sm:gap-4 flex-wrap",
|
||||
isMobile && "flex-col sm:flex-row",
|
||||
)}
|
||||
>
|
||||
@@ -32,6 +38,19 @@ export function AccountBulkActions({
|
||||
{selectedCount} compte{selectedCount > 1 ? "s" : ""} sélectionné
|
||||
{selectedCount > 1 ? "s" : ""}
|
||||
</span>
|
||||
{canMerge && (
|
||||
<Button
|
||||
size={isMobile ? "sm" : "sm"}
|
||||
variant="default"
|
||||
onClick={onMerge}
|
||||
className={cn(isMobile && "w-full sm:w-auto")}
|
||||
>
|
||||
<GitMerge
|
||||
className={cn(isMobile ? "w-3.5 h-3.5" : "w-4 h-4", "mr-1")}
|
||||
/>
|
||||
Fusionner
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
size={isMobile ? "sm" : "sm"}
|
||||
variant="destructive"
|
||||
|
||||
Reference in New Issue
Block a user