fix(frontend): remove unused imports and fix workspace type in homepage
This commit is contained in:
parent
c033cc3ff8
commit
a1ebe47564
@ -1,13 +1,10 @@
|
||||
import {Outlet} from 'react-router-dom';
|
||||
import {WorkspaceSidebar} from '@/components/layout/workspace-sidebar';
|
||||
import {useQuery} from '@tanstack/react-query';
|
||||
import {workspaceList} from '@/client';
|
||||
import {workspaceList, type WorkspaceInfoResponse} from '@/client';
|
||||
import {Spinner} from '@/components/ui/spinner';
|
||||
import {useNavigate} from 'react-router-dom';
|
||||
|
||||
export default function HomePageLayout() {
|
||||
const navigate = useNavigate();
|
||||
|
||||
const {data, isLoading} = useQuery({
|
||||
queryKey: ['workspaceList'],
|
||||
queryFn: async () => {
|
||||
@ -24,9 +21,8 @@ export default function HomePageLayout() {
|
||||
);
|
||||
}
|
||||
|
||||
const workspace = data?.workspaces?.[0];
|
||||
|
||||
if (!workspace) {
|
||||
const first = data?.workspaces?.[0];
|
||||
if (!first) {
|
||||
return (
|
||||
<div className="flex h-screen w-full items-center justify-center bg-background">
|
||||
<div className="text-muted-foreground">Loading workspace...</div>
|
||||
@ -34,6 +30,18 @@ export default function HomePageLayout() {
|
||||
);
|
||||
}
|
||||
|
||||
const workspace: WorkspaceInfoResponse = {
|
||||
slug: first.slug,
|
||||
name: first.name,
|
||||
description: first.description ?? null,
|
||||
my_role: first.my_role,
|
||||
avatar_url: first.avatar_url ?? null,
|
||||
member_count: data?.member_count ?? 0,
|
||||
project_count: data?.project_count ?? 0,
|
||||
created_at: first.created_at,
|
||||
updated_at: first.updated_at ?? first.created_at,
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="flex h-screen w-full bg-background">
|
||||
<WorkspaceSidebar workspace={workspace}/>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import {LandingLayout} from '@/components/landing/landing-layout';
|
||||
import {Bot, Globe, Lock, Network, Users} from 'lucide-react';
|
||||
import {Bot, Lock, Network, Users} from 'lucide-react';
|
||||
|
||||
const STATS = [
|
||||
{value: '12,400+', label: 'Active Agents'},
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import {LandingLayout} from '@/components/landing/landing-layout';
|
||||
import {useNavigate} from 'react-router-dom';
|
||||
import {Bot, Globe, Users} from 'lucide-react';
|
||||
import {Bot, Users} from 'lucide-react';
|
||||
|
||||
const PUBLIC_ROOMS = [
|
||||
{title: 'OSS Security Audit: actix-web', agents: 5, participants: 24, tags: ['security', 'rust', 'audit'], live: true},
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import {LandingLayout} from '@/components/landing/landing-layout';
|
||||
import {useNavigate} from 'react-router-dom';
|
||||
import {Cpu, DollarSign, ShieldCheck} from 'lucide-react';
|
||||
import {Cpu} from 'lucide-react';
|
||||
|
||||
const LIMITS = [
|
||||
{tier: 'Free', tokens: '100K', compute: '1x', agents: '3'},
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import {motion} from 'framer-motion';
|
||||
import {Bot, Brain, Code2, GitBranch, History, Layers, Network, ShieldCheck, Workflow, Zap} from 'lucide-react';
|
||||
import {Bot, Brain, Code2, GitBranch, History, Layers, Network, Workflow, Zap} from 'lucide-react';
|
||||
|
||||
const FEATURES = [
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user