import { useQuery } from '@tanstack/react-query' import { Container, Stack, Title, Text, SimpleGrid, Group, Button, TextInput, Loader } from '@mantine/core' import { useDebouncedValue } from '@mantine/hooks' import { useState } from 'react' import { createFileRoute } from '@tanstack/react-router' import { TbPlus, TbSearch } from 'react-icons/tb' import { DashboardLayout } from '@/frontend/components/DashboardLayout' import { AppCard } from '@/frontend/components/AppCard' export const Route = createFileRoute('/apps/')({ component: AppsPage, }) function AppsPage() { const [search, setSearch] = useState('') const [debouncedSearch] = useDebouncedValue(search, 300) const { data: apps, isLoading } = useQuery({ queryKey: ['apps', debouncedSearch], queryFn: () => fetch(`/api/apps?search=${encodeURIComponent(debouncedSearch)}`).then((r) => r.json()), }) return ( Applications Manage and monitor all your mobile applications from one place. {/* */} } style={{ flex: 1 }} radius="md" value={search} onChange={(e) => setSearch(e.currentTarget.value)} /> {isLoading ? ( ) : ( {apps?.map((app: any) => ( ))} )} ) }