feat: public boards
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
import { useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
|
||||
import { api } from "~/utils/api";
|
||||
import Button from "~/components/Button";
|
||||
import { useModal } from "~/providers/modal";
|
||||
import { usePopup } from "~/providers/popup";
|
||||
import { useWorkspace } from "~/providers/workspace";
|
||||
|
||||
import Button from "~/components/Button";
|
||||
import { api } from "~/utils/api";
|
||||
|
||||
export function DeleteWorkspaceConfirmation() {
|
||||
const { closeModal } = useModal();
|
||||
@@ -20,7 +19,7 @@ export function DeleteWorkspaceConfirmation() {
|
||||
onSuccess: () => {
|
||||
closeModal();
|
||||
const filteredWorkspaces = availableWorkspaces.filter(
|
||||
(ws) => ws.publicId !== workspace?.publicId,
|
||||
(ws) => ws.publicId !== workspace.publicId,
|
||||
);
|
||||
if (filteredWorkspaces.length > 0 && filteredWorkspaces[0]) {
|
||||
switchWorkspace(filteredWorkspaces[0]);
|
||||
@@ -33,13 +32,14 @@ export function DeleteWorkspaceConfirmation() {
|
||||
showPopup({
|
||||
header: "Error deleting workspace",
|
||||
message: "Please try again later, or contact customer support.",
|
||||
icon: "error",
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
const handleDeleteWorkspace = () => {
|
||||
deleteWorkspaceMutation.mutate({
|
||||
workspacePublicId: workspace?.publicId,
|
||||
workspacePublicId: workspace.publicId,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -47,7 +47,7 @@ export function DeleteWorkspaceConfirmation() {
|
||||
<div className="p-5">
|
||||
<div className="flex w-full flex-col justify-between pb-4">
|
||||
<h2 className="text-md pb-4 font-medium text-neutral-900 dark:text-dark-1000">
|
||||
{`Are you sure you want to delete the workspace ${workspace?.name}?`}
|
||||
{`Are you sure you want to delete the workspace ${workspace.name}?`}
|
||||
</h2>
|
||||
<p className="mb-4 text-sm text-light-900 dark:text-dark-900">
|
||||
Keep in mind that this action is irreversible.
|
||||
|
||||
Reference in New Issue
Block a user