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