import { useState, useCallback } from "preact/hooks"; import { useT } from "../../../shared/i18n/context"; interface AccountBulkActionsProps { selectedCount: number; loading: boolean; onBatchDelete: () => void; onSetActive: () => void; onSetDisabled: () => void; } export function AccountBulkActions({ selectedCount, loading, onBatchDelete, onSetActive, onSetDisabled, }: AccountBulkActionsProps) { const t = useT(); const [confirming, setConfirming] = useState(false); const handleDelete = useCallback(() => { if (!confirming) { setConfirming(true); return; } setConfirming(false); onBatchDelete(); }, [confirming, onBatchDelete]); const cancelConfirm = useCallback(() => setConfirming(false), []); if (selectedCount === 0) return null; return (
{selectedCount} {t("accountsCount")} {t("selected")} ); }