Skip to content
Source
Sign inSign up
TanStack/db
Open History to see the last commit

index.tsx

54 lines2.1 KB

1import { Link, createFileRoute } from "@tanstack/react-router"
2​
3export const Route = createFileRoute(`/`)({
4 component: HomePage,
5})
6​
7function HomePage() {
8 return (
9 <div className="min-h-screen flex items-center justify-center bg-gray-50">
10 <div className="max-w-md w-full bg-white rounded-lg shadow-lg p-8">
11 <h1 className="text-3xl font-bold text-center mb-8 text-gray-800">
12 TanStack React DB Demo
13 </h1>
14​
15 <p className="text-gray-600 text-center mb-8">
16 Choose a collection type to see how TanStack React DB works with
17 different data sources:
18 </p>
19​
20 <div className="space-y-4">
21 <Link to="/query" className="block w-full">
22 <button className="w-full px-6 py-4 bg-green-700 text-white rounded-lg hover:bg-green-800 transition-colors text-left">
23 <div className="font-semibold">Query Collections</div>
24 <div className="text-sm opacity-90 mt-1">
25 Traditional polling with TanStack Query
26 </div>
27 </button>
28 </Link>
29 <Link to="/electric" className="block w-full">
30 <button className="w-full px-6 py-4 bg-blue-500 text-white rounded-lg hover:bg-blue-600 transition-colors text-left">
31 <div className="font-semibold">Electric Collections</div>
32 <div className="text-sm opacity-90 mt-1">
33 Real-time sync with ElectricSQL
34 </div>
35 </button>
36 </Link>
37 <Link to="/trailbase" className="block w-full">
38 <button className="w-full px-6 py-4 bg-purple-600 text-white rounded-lg hover:bg-purple-700 transition-colors text-left">
39 <div className="font-semibold">TrailBase Collections</div>
40 <div className="text-sm opacity-90 mt-1">
41 Real-time sync with TrailBase
42 </div>
43 </button>
44 </Link>
45 </div>
46​
47 <div className="mt-8 text-xs text-center text-gray-500">
48 All examples use the same API and UI components, showcasing the
49 unified interface of TanStack React DB.
50 </div>
51 </div>
52 </div>
53 )