diff --git a/app/(app)/contacts/contacts-client.tsx b/app/(app)/contacts/contacts-client.tsx index b8b0926..82fafe0 100644 --- a/app/(app)/contacts/contacts-client.tsx +++ b/app/(app)/contacts/contacts-client.tsx @@ -4,6 +4,7 @@ import { useState } from 'react' import { Plus, X, Pencil, Contact as ContactIcon } from 'lucide-react' import { createContact, updateContact, deleteContact } from '@/lib/actions' import { useConfirm } from '@/components/ui/confirm' +import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog' import type { Tables } from '@/types/database' import { PageTitle } from '@/components/ui/page-title' import { Empty, EmptyHeader, EmptyMedia, EmptyTitle, EmptyContent } from '@/components/ui/empty' @@ -259,29 +260,23 @@ export function ContactsClient({ contacts: initialContacts }: { contacts: Contac )} - {showCreate && ( -
-
-
-

Add Contact

- -
- -
-
- )} + { if (!o) { setShowCreate(false); resetForm() } }}> + + + Add Contact + + + + - {editContact && ( -
-
-
-

Edit {editContact.name}

- -
- -
-
- )} + { if (!o) { setEditContact(null); resetForm() } }}> + + + {editContact ? `Edit ${editContact.name}` : 'Edit Contact'} + + + + ) } diff --git a/app/(app)/members/members-client.tsx b/app/(app)/members/members-client.tsx index 992181d..e4e1dc5 100644 --- a/app/(app)/members/members-client.tsx +++ b/app/(app)/members/members-client.tsx @@ -1,8 +1,9 @@ 'use client' import { useState } from 'react' -import { Plus, X, ChevronDown, Users } from 'lucide-react' +import { Plus, ChevronDown, Users } from 'lucide-react' import { Empty, EmptyHeader, EmptyMedia, EmptyTitle, EmptyDescription } from '@/components/ui/empty' +import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog' import { addMember, updateMember, approveMember, removeMember, assignAreaLead } from '@/lib/actions' import { toast } from 'sonner' import { useRouter } from 'next/navigation' @@ -382,48 +383,42 @@ export function MembersClient({ members: initialMembers, currentRole, areaLeadRo {/* Add Member Modal */} - {showAdd && ( -
-
-
-

Add Member

- + { if (!o) setShowAdd(false) }}> + + + Add Member + +
+ + {error &&

{error}

} +
+ +
- - - {error &&

{error}

} -
- - -
- -
-
- )} + + + {/* Edit Member Modal */} - {editMember && ( -
-
-
-

Edit {editMember.display_name}

- + { if (!o) setEditMember(null) }}> + + + Edit {editMember?.display_name} + +
+ + {error &&

{error}

} +
+ +
- - - {error &&

{error}

} -
- - -
- -
-
- )} + + +
) } diff --git a/app/(app)/ops/ops-client.tsx b/app/(app)/ops/ops-client.tsx index c8ca5c9..6254b16 100644 --- a/app/(app)/ops/ops-client.tsx +++ b/app/(app)/ops/ops-client.tsx @@ -2,7 +2,7 @@ import { useState, useMemo } from 'react' import { useRouter } from 'next/navigation' -import { Plus, Search, Lock, Pin, Eye, EyeOff, Pencil, Trash2, X, ChevronDown, Users2, FileText } from 'lucide-react' +import { Plus, Search, Lock, Pin, Eye, EyeOff, Pencil, Trash2, ChevronDown, Users2, FileText } from 'lucide-react' import ReactMarkdown from 'react-markdown' import remarkGfm from 'remark-gfm' import { createKbEntry, updateKbEntry, deleteKbEntry } from '@/lib/actions' @@ -12,6 +12,7 @@ import { createClient } from '@/lib/supabase/client' import { toast } from 'sonner' import type { Tables, TablesInsert } from '@/types/database' import { PageTitle } from '@/components/ui/page-title' +import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog' import { useConfirm } from '@/components/ui/confirm' import { Empty, EmptyHeader, EmptyMedia, EmptyTitle, EmptyContent } from '@/components/ui/empty' @@ -94,13 +95,12 @@ function KbModal({ } return ( -
-
e.stopPropagation()}> -
-

{isEdit ? 'Edit Entry' : 'New KB Entry'}

- -
-
+ { if (!o) onClose() }}> + + + {isEdit ? 'Edit Entry' : 'New KB Entry'} + +
-
-
+ + ) } @@ -222,13 +222,12 @@ function AddSecretModal({ } return ( -
-
e.stopPropagation()}> -
-

Add Secret / Credential

- -
-
+ { if (!o) onClose() }}> + + + Add Secret / Credential + +
-
-
+ + ) } @@ -317,13 +316,12 @@ function AreaLeadModal({ } return ( -
-
e.stopPropagation()}> -
-

{isEdit ? 'Edit Area Lead' : 'Add Area Lead'}

- -
-
+ { if (!o) onClose() }}> + + + {isEdit ? 'Edit Area Lead' : 'Add Area Lead'} + +
setAreaName(e.target.value)} className="w-full bg-background border border-border rounded px-3 py-2 font-sans text-sm text-foreground focus:outline-none focus:border-primary transition" placeholder="e.g. Woodshop" required /> @@ -343,8 +341,8 @@ function AreaLeadModal({
-
-
+ + ) } @@ -507,17 +505,14 @@ function KbEntryRow({
- {viewing && ( -
setViewing(false)}> -
e.stopPropagation()} - className="bg-card rounded border border-border w-full max-w-3xl max-h-[90vh] overflow-y-auto" - > -
+ { if (!o) setViewing(false) }}> + + +
{entry.icon && {entry.icon}} -

{entry.title}

+ {entry.title} {entry.is_pinned && }

@@ -530,26 +525,23 @@ function KbEntryRow({ -

-
-
- {entry.content ?? ''} -
- {canManageAcl && ( - - )} + +
+
+ {entry.content ?? ''}
+ {canManageAcl && ( + + )}
-
- )} + +
) } diff --git a/app/(app)/payments/payments-client.tsx b/app/(app)/payments/payments-client.tsx index 043ca80..eb946cf 100644 --- a/app/(app)/payments/payments-client.tsx +++ b/app/(app)/payments/payments-client.tsx @@ -1,8 +1,9 @@ 'use client' import { useState } from 'react' -import { X, RefreshCcw, Receipt } from 'lucide-react' +import { RefreshCcw, Receipt } from 'lucide-react' import { Empty, EmptyHeader, EmptyMedia, EmptyTitle, EmptyDescription } from '@/components/ui/empty' +import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription } from '@/components/ui/dialog' import { toast } from 'sonner' import { logCashPayment, linkPaymentToMember } from '@/lib/actions' import type { Tables } from '@/types/database' @@ -262,14 +263,12 @@ export function PaymentsClient({ payments: initialPayments, members, integration
{/* Log Cash Modal */} - {showLogCash && ( -
-
-
-

Log Cash Payment

- -
-
+ { if (!o) setShowLogCash(false) }}> + + + Log Cash Payment + +
@@ -308,44 +307,40 @@ export function PaymentsClient({ payments: initialPayments, members, integration
-
-
- )} + + {/* Link Member Modal */} - {linkingPayment && ( -
-
-
-
-

Link to Member

-

- {'$'}{linkingPayment.amount} via {linkingPayment.platform?.toUpperCase()} — {linkingPayment.from_identifier} -

-
- -
-
- {members.map(m => ( - - ))} -
+ { if (!o) setLinkingPayment(null) }}> + + + Link to Member + {linkingPayment && ( + + {'$'}{linkingPayment.amount} via {linkingPayment.platform?.toUpperCase()} · {linkingPayment.from_identifier} + + )} + +
+ {linkingPayment && members.map(m => ( + + ))}
-
- )} + +
) } diff --git a/app/(app)/projects/projects-client.tsx b/app/(app)/projects/projects-client.tsx index 922172c..78bc4a0 100644 --- a/app/(app)/projects/projects-client.tsx +++ b/app/(app)/projects/projects-client.tsx @@ -8,6 +8,7 @@ import { useConfirm } from '@/components/ui/confirm' import type { Tables } from '@/types/database' import { PageTitle } from '@/components/ui/page-title' import { Empty, EmptyHeader, EmptyMedia, EmptyTitle, EmptyDescription, EmptyContent } from '@/components/ui/empty' +import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog' type Project = Tables<'projects'> @@ -164,14 +165,12 @@ export function ProjectsClient({ )}
- {showCreate && ( -
-
-
-

New Project

- -
-
+ { if (!o) setShowCreate(false) }}> + + + New Project + +
setForm(f => ({ ...f, title: e.target.value }))} @@ -212,9 +211,8 @@ export function ProjectsClient({
-
-
- )} + +
) } diff --git a/app/(app)/settings/settings-client.tsx b/app/(app)/settings/settings-client.tsx index 2f8dffb..c91ddc6 100644 --- a/app/(app)/settings/settings-client.tsx +++ b/app/(app)/settings/settings-client.tsx @@ -1,13 +1,14 @@ 'use client' import { useState } from 'react' -import { X, Check, Copy, Eye, EyeOff, RotateCcw } from 'lucide-react' +import { Check, Copy, Eye, EyeOff, RotateCcw } from 'lucide-react' import { updateSpaceSettings, saveIntegration, disconnectIntegration, rotateWebhookSecret, updateSpaceVisibility, createArea, updateArea, deleteArea, createTier, updateTier, deleteTier, createInvite, updateInvite, deleteInvite, createOnboardingStep, updateOnboardingStep, deleteOnboardingStep } from '@/lib/actions' import { toast } from 'sonner' import { financialVisibilities, directoryVisibilities } from '@/lib/validations' import type { Tables } from '@/types/database' import { PageTitle } from '@/components/ui/page-title' +import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog' type Space = Tables<'spaces'> type Integration = Tables<'integrations'> @@ -567,20 +568,18 @@ export default function SettingsClient({ space, isAdmin, integrations, currentRo
{/* Integration Config Modal */} - {editingIntegration && ( -
-
-
-
-
{editingIntegration.icon}
-

{editingIntegration.name}

-
- -
+ { if (!o) setEditingIntegration(null) }}> + + {editingIntegration && ( + <> + + +
{editingIntegration.icon}
+ {editingIntegration.name} +
+
-
+ {editingIntegration.fields.map(field => (
@@ -656,9 +655,10 @@ export default function SettingsClient({ space, isAdmin, integrations, currentRo
-
-
- )} + + )} + + ) } diff --git a/app/(app)/tasks/tasks-client.tsx b/app/(app)/tasks/tasks-client.tsx index 1042a48..edac896 100644 --- a/app/(app)/tasks/tasks-client.tsx +++ b/app/(app)/tasks/tasks-client.tsx @@ -7,6 +7,7 @@ import { toast } from 'sonner' import type { Tables } from '@/types/database' import { PageTitle } from '@/components/ui/page-title' import { Empty, EmptyHeader, EmptyMedia, EmptyTitle, EmptyContent } from '@/components/ui/empty' +import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog' type Task = Tables<'tasks'> @@ -244,17 +245,13 @@ export function TasksClient({ tasks: initialTasks, members, currentUserId, space {/* Create Task Modal */} - {showCreate && ( -
-
-
-

New Task

- -
+ { if (!o) setShowCreate(false) }}> + + + New Task + -
+
-
-
- )} + + ) }