feat: add dashboard client components for finance, journal, projects, tasks, analytics, calendar, clients, and main overview

This commit is contained in:
Poyraz
2026-06-16 18:45:51 +03:00
parent 5486a19d57
commit 3634b3a227
8 changed files with 82 additions and 33 deletions
+15 -6
View File
@@ -19,6 +19,7 @@ import {
SelectItem,
SelectTrigger,
SelectValue,
toast,
} from "poyraz-ui/molecules";
import { CalendarDays, Clock, Pencil, Plus, Trash2 } from "lucide-react";
import { useMemo, useState } from "react";
@@ -293,6 +294,13 @@ function CalendarEventDialog({
try {
await action(formData);
setOpen(false);
toast.success(mode === "create" ? "Etkinlik eklendi." : "Etkinlik güncellendi.");
} catch (error) {
toast.error(
error instanceof Error
? error.message
: "Etkinlik kaydedilirken beklenmeyen bir hata oluştu.",
);
} finally {
setIsSubmitting(false);
}
@@ -306,20 +314,21 @@ function CalendarEventDialog({
{mode === "create" ? "Etkinlik ekle" : "Düzenle"}
</Button>
</DialogTrigger>
<DialogContent className="max-h-[min(680px,calc(100dvh-6rem))] overflow-hidden sm:max-w-xl">
<form action={handleSubmit} className="flex max-h-[min(640px,calc(100dvh-9rem))] flex-col">
<DialogContent className="flex max-h-[calc(100dvh-2rem)] w-[calc(100vw-2rem)] flex-col overflow-hidden p-0 sm:max-h-[min(680px,calc(100dvh-4rem))] sm:max-w-xl data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95">
<form action={handleSubmit} className="flex min-h-0 flex-1 flex-col overflow-hidden">
{event ? <input type="hidden" name="id" value={event.id} /> : null}
<DialogHeader className="shrink-0 pb-5">
<DialogHeader className="shrink-0 px-5 pb-4 pt-5 pr-12">
<DialogTitle>{mode === "create" ? "Yeni etkinlik" : "Etkinliği düzenle"}</DialogTitle>
<DialogDescription>Takvim etkinliğini proje, görev veya müşteriyle ilişkilendir.</DialogDescription>
</DialogHeader>
<div className="tiny-scrollbar min-h-0 flex-1 overflow-y-auto pr-2">
<div className="tiny-scrollbar min-h-0 flex-1 overflow-y-auto px-5 pb-5">
<EventFormFields event={event} defaultDate={defaultDate} clients={clients} projects={projects} tasks={tasks} />
</div>
<DialogFooter className="shrink-0 border-t border-border pt-5">
<Button type="submit" disabled={isSubmitting}>
<DialogFooter className="shrink-0 border-t border-border bg-background p-5">
<Button type="submit" disabled={isSubmitting} className="w-full gap-2 sm:w-auto">
{mode === "create" ? <Plus className="h-4 w-4" /> : <Pencil className="h-4 w-4" />}
{isSubmitting ? "Kaydediliyor" : mode === "create" ? "Etkinliği ekle" : "Değişiklikleri kaydet"}
</Button>
</DialogFooter>