updated breakcore theme

This commit is contained in:
2026-05-15 15:44:08 +02:00
parent 85b699739b
commit 7294dd47ef
8 changed files with 501 additions and 9 deletions
+9 -2
View File
@@ -1,5 +1,6 @@
import { useEffect, useRef, useState } from 'react';
import { deletePost } from '../../lib/api';
import { confirmDialog, notify } from '../../lib/confirm';
const PAGE_SIZE = 9;
@@ -66,13 +67,19 @@ export default function PostList({ posts: initialPosts, isAdmin = false }: Props
async function handleDelete(slug: string, title: string) {
if (deleting) return;
if (!window.confirm(`Take "${title}" off the wall? This cannot be undone.`)) return;
const ok = await confirmDialog({
title: 'Take this off the wall?',
message: `${title}” will be removed from the catalogue. This cannot be undone.`,
confirmLabel: 'Remove',
cancelLabel: 'Keep',
});
if (!ok) return;
setDeleting(slug);
try {
await deletePost(slug);
setPosts(p => p.filter(x => x.slug !== slug));
} catch (e) {
window.alert(`Failed to remove: ${e instanceof Error ? e.message : 'unknown error'}`);
notify(`Failed to remove: ${e instanceof Error ? e.message : 'unknown error'}`);
} finally {
setDeleting(null);
}