diff --git a/apps/app/src/components/Changelog/VersionDelete.tsx b/apps/app/src/components/Changelog/VersionDelete.tsx
new file mode 100644
index 0000000..5aa4cdb
--- /dev/null
+++ b/apps/app/src/components/Changelog/VersionDelete.tsx
@@ -0,0 +1,82 @@
+import {
+ Alert,
+ AlertDescription,
+ AlertDialog,
+ AlertDialogAction,
+ AlertDialogCancel,
+ AlertDialogContent,
+ AlertDialogDescription,
+ AlertDialogFooter,
+ AlertDialogHeader,
+ AlertDialogTitle,
+ AlertDialogTrigger,
+ AlertTitle,
+ Button,
+} from '@boring.tools/ui'
+import { useNavigate } from '@tanstack/react-router'
+import { TriangleAlertIcon } from 'lucide-react'
+import { useState } from 'react'
+import { useChangelogVersionRemove } from '../../hooks/useChangelog'
+
+export const ChangelogVersionDelete = ({
+ id,
+ versionId,
+}: { id: string; versionId: string }) => {
+ const remove = useChangelogVersionRemove()
+ const navigate = useNavigate({ from: `/changelog/${id}` })
+ const [isOpen, setIsOpen] = useState(false)
+
+ const removeChangelogVersion = () => {
+ remove.mutate(
+ { id: versionId },
+ {
+ onSuccess: () => {
+ setIsOpen(false)
+ navigate({ to: '/changelog/$id', params: { id } })
+ },
+ },
+ )
+ }
+ return (
+
+
+ Danger Zone
+
+ You can remove your version here. You cannot undo this.
+
+
+
+
+
+
+ Are you absolutely sure?
+
+ This action cannot be undone. This will permanently delete your
+ version and remove your data from our servers.
+
+
+
+ setIsOpen(false)}>
+ Cancel
+
+
+
+
+
+
+
+
+
+ )
+}
diff --git a/apps/app/src/hooks/useChangelog.ts b/apps/app/src/hooks/useChangelog.ts
index 5b5379f..dc47add 100644
--- a/apps/app/src/hooks/useChangelog.ts
+++ b/apps/app/src/hooks/useChangelog.ts
@@ -171,3 +171,22 @@ export const useChangelogVersionUpdate = () => {
},
})
}
+
+export const useChangelogVersionRemove = () => {
+ const { getToken } = useAuth()
+ const queryClient = useQueryClient()
+
+ return useMutation({
+ mutationFn: async ({ id }: { id: string }): Promise> =>
+ await queryFetch({
+ path: `changelog/version/${id}`,
+ method: 'delete',
+ token: await getToken(),
+ }),
+ onSuccess: (data) => {
+ queryClient.invalidateQueries({
+ queryKey: ['changelogList', 'changelogById', data.id],
+ })
+ },
+ })
+}
diff --git a/apps/app/src/routes/changelog.$id.version.$versionId.tsx b/apps/app/src/routes/changelog.$id.version.$versionId.tsx
index f700570..bd3609d 100644
--- a/apps/app/src/routes/changelog.$id.version.$versionId.tsx
+++ b/apps/app/src/routes/changelog.$id.version.$versionId.tsx
@@ -1,5 +1,8 @@
import { VersionUpdateInput } from '@boring.tools/schema'
import {
+ Alert,
+ AlertDescription,
+ AlertTitle,
Button,
Calendar,
Form,
@@ -41,8 +44,9 @@ import {
} from '../hooks/useChangelog'
import '@mdxeditor/editor/style.css'
import { format } from 'date-fns'
-import { CalendarIcon } from 'lucide-react'
+import { CalendarIcon, TriangleAlertIcon } from 'lucide-react'
import { useEffect, useRef } from 'react'
+import { ChangelogVersionDelete } from '../components/Changelog/VersionDelete'
import { VersionStatus } from '../components/Changelog/VersionStatus'
const Component = () => {
@@ -234,6 +238,8 @@ const Component = () => {
+
+
)}