-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bbdab06
commit a45978e
Showing
22 changed files
with
5,693 additions
and
281 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
...ettings/(settings)/workspace/integrations/(integration)/github/DeleteGithubUserButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"use client"; | ||
|
||
import { useRouter } from "next/navigation"; | ||
|
||
import { Button } from "@ctrlplane/ui/button"; | ||
|
||
import { api } from "~/trpc/react"; | ||
|
||
export const DeleteGithubUserButton: React.FC<{ githubUserId: string }> = ({ | ||
githubUserId, | ||
}) => { | ||
const deleteGithubUser = api.github.user.delete.useMutation(); | ||
const router = useRouter(); | ||
|
||
const handleDelete = () => | ||
deleteGithubUser.mutateAsync(githubUserId).then(() => router.refresh()); | ||
|
||
return ( | ||
<Button variant="secondary" onClick={handleDelete}> | ||
Disconnect | ||
</Button> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.