This repository has been archived on 2026-11-18. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
everythingbutwork/apps/web/src/components/blocker/BlockerDialog.tsx
T
dejanandClaude Opus 4.7 4f33509a0f
ci / quality (push) Has been cancelled
ci / build (push) Has been cancelled
Initial commit: everythingbutwork MVP
Internes Project-Management-Tool für ToolCTRL — ergänzend zu Plane (Tickets)
und Outline (Doku). Umfasst Puls-Übersicht, Tagesrhythmus (Lock-in + Reflexion),
Bereichs-Detail-Views (Entwicklung/Vertrieb/Marketing), Pflicht-Minimum-Check
und Blocker-Lifecycle gemäß Projektmanagement-Leitfaden v3.0.

Stack: pnpm-Monorepo · Vite + React 18 + Tailwind · Fastify + tRPC v11 +
Drizzle ORM · Postgres 16 · Authentik OIDC (Phase 2, Dev-Auto-Login aktiv).

Planungs-Artefakte unter _bmad-output/planning-artifacts/.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 22:47:26 +02:00

72 lines
2.5 KiB
TypeScript

import { useState } from 'react';
import { toast } from 'sonner';
import { trpc } from '../../lib/trpc';
import { voice } from '../../lib/voice';
import { Button } from '../ui/Button';
export function BlockerDialog({ onClose }: { onClose: () => void }) {
const [title, setTitle] = useState('');
const [description, setDescription] = useState('');
const utils = trpc.useUtils();
const mutation = trpc.blocker.create.useMutation({
onSuccess: async () => {
toast(voice.toast.blockerOpened);
await utils.puls.overview.invalidate();
onClose();
},
});
function submit(e: React.FormEvent) {
e.preventDefault();
if (!title.trim()) return;
mutation.mutate({ title: title.trim(), description: description.trim() || undefined });
}
return (
<div
className="fixed inset-0 z-50 flex items-center justify-center bg-black/30"
onClick={onClose}
>
<div
className="w-full max-w-md rounded-[var(--radius-xl)] bg-[var(--color-bg)] p-6 shadow-[var(--shadow-lg)]"
onClick={(e) => e.stopPropagation()}
>
<h2 className="text-xl font-semibold">Neuer Blocker</h2>
<form onSubmit={submit} className="mt-4 space-y-3">
<label className="block">
<span className="text-sm font-medium">Was klemmt?</span>
<input
required
ref={(el) => {
if (el && !title) el.focus();
}}
value={title}
onChange={(e) => setTitle(e.target.value)}
maxLength={200}
className="mt-1 w-full rounded-[var(--radius-md)] border border-[var(--color-border)] bg-white px-3 py-2 text-sm"
/>
</label>
<label className="block">
<span className="text-sm font-medium">Mehr Kontext (optional)</span>
<textarea
value={description}
onChange={(e) => setDescription(e.target.value)}
rows={3}
maxLength={1000}
className="mt-1 w-full rounded-[var(--radius-md)] border border-[var(--color-border)] bg-white px-3 py-2 text-sm"
/>
</label>
<div className="flex justify-end gap-2 pt-2">
<Button type="button" variant="ghost" onClick={onClose}>
Abbrechen
</Button>
<Button type="submit" disabled={mutation.isPending}>
Erstellen
</Button>
</div>
</form>
</div>
</div>
);
}