+27









sean-brydon
Udit Takkar
Hariom Balhara
Leo Giovanetti
Alex van Andel
CarinaWolli
zomars
Peer Richelsen
Joe Au-Yeung
Udit Takkar
Keith Williams
Peer Richelsen
Syed Ali Shahbaz
gitstart-calcom
Shivam Kalra
cherish2003
rkreddy99
varun thummar
Crowdin Bot
Pradumn Kumar
Richard Poelderl
mohammed hussam
Carina Wollendorfer
Anik Dhabal Babu
nicktrn
sydwardrae
Janakiram Yellapu
GitStart-Cal.com
sajanlamsal
Cherish
Danila
Neel Patel
Rama Krishna Reddy
Varun Thummar
Bhargav
Pratik Kumar
Ritesh Patil
10ffd9bacd
Co-authored-by: Udit Takkar <[email protected]> Co-authored-by: Hariom Balhara <[email protected]> Co-authored-by: Leo Giovanetti <[email protected]> Co-authored-by: Alex van Andel <[email protected]> Co-authored-by: CarinaWolli <[email protected]> Co-authored-by: zomars <[email protected]> Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: Joe Au-Yeung <[email protected]> Co-authored-by: Udit Takkar <[email protected]> Co-authored-by: Keith Williams <[email protected]> Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: Syed Ali Shahbaz <[email protected]> Co-authored-by: gitstart-calcom <[email protected]> Co-authored-by: Shivam Kalra <[email protected]> Co-authored-by: cherish2003 <[email protected]> Co-authored-by: sean-brydon <[email protected]> Co-authored-by: rkreddy99 <[email protected]> Co-authored-by: varun thummar <Varun> Co-authored-by: Crowdin Bot <[email protected]> Co-authored-by: Pradumn Kumar <[email protected]> Co-authored-by: Richard Poelderl <[email protected]> Co-authored-by: mohammed hussam <[email protected]> Co-authored-by: Carina Wollendorfer <[email protected]> Co-authored-by: Anik Dhabal Babu <[email protected]> Co-authored-by: nicktrn <[email protected]> Co-authored-by: sydwardrae <[email protected]> Co-authored-by: Janakiram Yellapu <[email protected]> Co-authored-by: GitStart-Cal.com <[email protected]> Co-authored-by: sajanlamsal <[email protected]> Co-authored-by: Cherish <[email protected]> Co-authored-by: Danila <[email protected]> Co-authored-by: Neel Patel <[email protected]> Co-authored-by: Rama Krishna Reddy <[email protected]> Co-authored-by: Varun Thummar <[email protected]> Co-authored-by: Bhargav <[email protected]> Co-authored-by: Pratik Kumar <[email protected]> Co-authored-by: Ritesh Patil <[email protected]>
50 lines
1.4 KiB
TypeScript
50 lines
1.4 KiB
TypeScript
import { BanIcon } from "lucide-react";
|
|
|
|
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
|
import { trpc } from "@calcom/trpc/react";
|
|
import { Dialog, DialogTrigger, ConfirmationDialogContent, Button, showToast } from "@calcom/ui";
|
|
|
|
import type { User } from "../UserListTable";
|
|
|
|
interface Props {
|
|
users: User[];
|
|
}
|
|
|
|
export function DeleteBulkUsers({ users }: Props) {
|
|
const { t } = useLocale();
|
|
const selectedRows = users; // Get selected rows from table
|
|
const utils = trpc.useContext();
|
|
const deleteMutation = trpc.viewer.organizations.bulkDeleteUsers.useMutation({
|
|
onSuccess: () => {
|
|
utils.viewer.organizations.listMembers.invalidate();
|
|
showToast("Deleted Users", "success");
|
|
},
|
|
onError: (error) => {
|
|
showToast(error.message, "error");
|
|
},
|
|
});
|
|
return (
|
|
<Dialog>
|
|
<DialogTrigger asChild>
|
|
<Button StartIcon={BanIcon}>{t("Delete")}</Button>
|
|
</DialogTrigger>
|
|
<ConfirmationDialogContent
|
|
variety="danger"
|
|
title={t("remove_users_from_org")}
|
|
confirmBtnText={t("remove")}
|
|
isLoading={deleteMutation.isLoading}
|
|
onConfirm={() => {
|
|
deleteMutation.mutateAsync({
|
|
userIds: selectedRows.map((user) => user.id),
|
|
});
|
|
}}>
|
|
<p className="mt-5">
|
|
{t("remove_users_from_org_confirm", {
|
|
userCount: selectedRows.length,
|
|
})}
|
|
</p>
|
|
</ConfirmationDialogContent>
|
|
</Dialog>
|
|
);
|
|
}
|