diff --git a/components/settings/unified/tabs/WorkspaceAuditTab.tsx b/components/settings/unified/tabs/WorkspaceAuditTab.tsx index 208d59f..1f156a9 100644 --- a/components/settings/unified/tabs/WorkspaceAuditTab.tsx +++ b/components/settings/unified/tabs/WorkspaceAuditTab.tsx @@ -1,7 +1,7 @@ 'use client' import { useState, useEffect } from 'react' -import { Spinner } from '@ciphera-net/ui' +import { Spinner, Input, Button } from '@ciphera-net/ui' import { useAuth } from '@/lib/auth/context' import { getAuditLog, type AuditLogEntry } from '@/lib/api/audit' import { formatDateTimeShort } from '@/lib/utils/formatDate' @@ -72,48 +72,46 @@ export default function WorkspaceAuditTab() {
- { setActionFilter(e.target.value); setPage(1) }} placeholder="e.g. site_created" - className="px-3 py-1.5 border border-neutral-700 rounded-lg bg-neutral-900 text-white text-sm w-40" + className="w-40" />
- { setStartDate(e.target.value); setPage(1) }} - className="px-3 py-1.5 border border-neutral-700 rounded-lg bg-neutral-900 text-white text-sm" />
- { setEndDate(e.target.value); setPage(1) }} - className="px-3 py-1.5 border border-neutral-700 rounded-lg bg-neutral-900 text-white text-sm" />
{(actionFilter || startDate || endDate) && ( - + )}
{entries.length === 0 ? (

No activity recorded yet.

) : ( -
+
{entries.map(entry => ( -
+

{entry.actor_email || 'System'} @@ -132,25 +130,27 @@ export default function WorkspaceAuditTab() {

)} -
+
{total > 0 ? `${(page - 1) * PAGE_SIZE + 1}–${Math.min(page * PAGE_SIZE, total)} of ${total}` : 'No entries'}
- - +
diff --git a/components/settings/unified/tabs/WorkspaceBillingTab.tsx b/components/settings/unified/tabs/WorkspaceBillingTab.tsx index 8fe0e78..e61c7cc 100644 --- a/components/settings/unified/tabs/WorkspaceBillingTab.tsx +++ b/components/settings/unified/tabs/WorkspaceBillingTab.tsx @@ -93,7 +93,7 @@ export default function WorkspaceBillingTab() {
{/* Plan card */} -
+

{planLabel} Plan

@@ -173,7 +173,7 @@ export default function WorkspaceBillingTab() { {/* Recent Invoices */} {orders.length > 0 && ( -
+

Recent Invoices

{orders.map(order => ( diff --git a/components/settings/unified/tabs/WorkspaceGeneralTab.tsx b/components/settings/unified/tabs/WorkspaceGeneralTab.tsx index bb1bc5c..242099e 100644 --- a/components/settings/unified/tabs/WorkspaceGeneralTab.tsx +++ b/components/settings/unified/tabs/WorkspaceGeneralTab.tsx @@ -8,6 +8,7 @@ import { useAuth } from '@/lib/auth/context' import { getOrganization, updateOrganization, deleteOrganization } from '@/lib/api/organization' import { getAuthErrorMessage } from '@ciphera-net/ui' import { useUnifiedSettings } from '@/lib/unified-settings-context' +import { DangerZone } from '@/components/settings/unified/DangerZone' export default function WorkspaceGeneralTab({ onDirtyChange, onRegisterSave }: { onDirtyChange?: (dirty: boolean) => void; onRegisterSave?: (fn: () => Promise) => void }) { const { user } = useAuth() @@ -83,7 +84,7 @@ export default function WorkspaceGeneralTab({ onDirtyChange, onRegisterSave }: { } return ( -
+

General Information

@@ -106,57 +107,47 @@ export default function WorkspaceGeneralTab({ onDirtyChange, onRegisterSave }: {
{/* Danger Zone */} -
-

Danger Zone

-
-
+ setShowDeleteConfirm(prev => !prev), + }]} + > + {showDeleteConfirm && ( +
+

This will permanently delete:

+
    +
  • All sites and their analytics data
  • +
  • All team members and pending invitations
  • +
  • Active subscription will be cancelled
  • +
  • All notifications and settings
  • +
-

Delete Organization

-

Permanently delete this organization and all its data.

+ + setDeleteText(e.target.value)} + placeholder="DELETE" + /> +
+
+ +
-
- {showDeleteConfirm && ( -
-

This will permanently delete:

-
    -
  • All sites and their analytics data
  • -
  • All team members and pending invitations
  • -
  • Active subscription will be cancelled
  • -
  • All notifications and settings
  • -
-
- - setDeleteText(e.target.value)} - className="w-full px-3 py-2 border border-neutral-700 rounded-lg bg-neutral-900 text-white text-sm" - placeholder="DELETE" - /> -
-
- - -
-
- )} -
-
+ )} +
) } diff --git a/components/settings/unified/tabs/WorkspaceMembersTab.tsx b/components/settings/unified/tabs/WorkspaceMembersTab.tsx index f030476..c95492c 100644 --- a/components/settings/unified/tabs/WorkspaceMembersTab.tsx +++ b/components/settings/unified/tabs/WorkspaceMembersTab.tsx @@ -166,11 +166,14 @@ export default function WorkspaceMembersTab() {
))} + {members.length === 0 && ( +

No members found.

+ )}
{/* Pending Invitations */} {invitations.length > 0 && ( -
+

Pending Invitations

{invitations.map(inv => (
diff --git a/components/settings/unified/tabs/WorkspaceNotificationsTab.tsx b/components/settings/unified/tabs/WorkspaceNotificationsTab.tsx index 7032999..c024a0d 100644 --- a/components/settings/unified/tabs/WorkspaceNotificationsTab.tsx +++ b/components/settings/unified/tabs/WorkspaceNotificationsTab.tsx @@ -74,7 +74,7 @@ export default function WorkspaceNotificationsTab({ onDirtyChange, onRegisterSav ))} {(!data?.categories || data.categories.length === 0) && ( -

No notification preferences available.

+

No notification preferences available.

)}