improvement: treatment UX fully overhauled.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import { useSearchParams } from 'next/navigation';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { useToast } from '@/lib/hooks/useToast';
|
||||
import { Check, History, Trash2, UserPlus, X } from 'lucide-react';
|
||||
@@ -25,6 +26,7 @@ import { Input } from '@/components/ui/shared/Input';
|
||||
import { SearchBar } from '@/components/ui/shared/SearchBar';
|
||||
import { Table } from '@/components/ui/shared/Table';
|
||||
import { getUserFacingError } from '@/components/shared/formatApiError';
|
||||
import { useRouter } from '@/i18n/navigation';
|
||||
|
||||
function formatOrganizationStatusLabel(status: string): string {
|
||||
if (!status) return status;
|
||||
@@ -45,6 +47,8 @@ export function OrganizationsPage() {
|
||||
const tErrors = useTranslations('errors');
|
||||
const tNav = useTranslations('nav');
|
||||
const tCommon = useTranslations('common');
|
||||
const searchParams = useSearchParams();
|
||||
const router = useRouter();
|
||||
const { currentOrganization } = useAuth();
|
||||
const [loading, setLoading] = useState(true);
|
||||
const toast = useToast();
|
||||
@@ -123,6 +127,14 @@ export function OrganizationsPage() {
|
||||
void loadList();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (searchParams.get('action') !== 'invite-lab') {
|
||||
return;
|
||||
}
|
||||
setShowInviteForm(true);
|
||||
router.replace('/organizations');
|
||||
}, [searchParams, router]);
|
||||
|
||||
useEffect(() => {
|
||||
let cancelled = false;
|
||||
const q = query.trim();
|
||||
|
||||
Reference in New Issue
Block a user