@@ -63,10 +63,15 @@ const features = [
6363 } ,
6464] ;
6565
66- const sqlCode = `-- Evaluate JSONata inside SQL queries
67- SELECT jsonata('price * quantity', data)
68- FROM orders
69- WHERE jsonata('status = "shipped"', data);` ;
66+ const sqlCode = `SELECT status, count(*) as orders,
67+ jsonata_query('{
68+ "revenue": $round($sum(total), 2),
69+ "avg": $round($average(total), 2),
70+ "top": $max(total)
71+ }', data) as stats
72+ FROM orders
73+ GROUP BY status
74+ ORDER BY orders DESC;` ;
7075
7176const reactCode = `import { JsonataPlayground } from '@gnata-sqlite/react'
7277
@@ -165,6 +170,53 @@ export default async function HomePage() {
165170 </ a >
166171 </ section >
167172
173+ { /* Code examples */ }
174+ < section className = "mx-auto max-w-5xl px-6 py-16" >
175+ < h2 className = "mb-8 text-center text-2xl font-bold landing-text-strong" >
176+ From database to browser
177+ </ h2 >
178+
179+ < div className = "grid gap-6 lg:grid-cols-2" >
180+ { /* SQL example */ }
181+ < div className = "overflow-hidden rounded-md border landing-code-bg" >
182+ < div
183+ className = "flex items-center gap-2 border-b px-4 py-2 text-xs font-semibold landing-code-header"
184+ style = { { borderLeft : '3px solid #7aa2f7' } }
185+ >
186+ < Database className = "size-3.5" style = { { color : '#7aa2f7' } } />
187+ SQLite Extension
188+ </ div >
189+ < div
190+ className = "overflow-x-auto text-[13px] leading-relaxed [&_pre]:!m-0 [&_pre]:!rounded-none [&_pre]:!p-4"
191+ style = { {
192+ fontFamily :
193+ 'ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace' ,
194+ } }
195+ dangerouslySetInnerHTML = { { __html : sqlHtml } }
196+ />
197+ </ div >
198+
199+ { /* React example */ }
200+ < div className = "overflow-hidden rounded-md border landing-code-bg" >
201+ < div
202+ className = "flex items-center gap-2 border-b px-4 py-2 text-xs font-semibold landing-code-header"
203+ style = { { borderLeft : '3px solid #bb9af7' } }
204+ >
205+ < Component className = "size-3.5" style = { { color : '#bb9af7' } } />
206+ React Editor
207+ </ div >
208+ < div
209+ className = "overflow-x-auto text-[13px] leading-relaxed [&_pre]:!m-0 [&_pre]:!rounded-none [&_pre]:!p-4"
210+ style = { {
211+ fontFamily :
212+ 'ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace' ,
213+ } }
214+ dangerouslySetInnerHTML = { { __html : reactHtml } }
215+ />
216+ </ div >
217+ </ div >
218+ </ section >
219+
168220 { /* Features grid */ }
169221 < section className = "mx-auto max-w-5xl px-6 py-16" >
170222 < div className = "grid gap-6 sm:grid-cols-2" >
@@ -211,53 +263,6 @@ export default async function HomePage() {
211263 < ScreenshotGallery />
212264 </ section >
213265
214- { /* Code examples */ }
215- < section className = "mx-auto max-w-5xl px-6 py-16" >
216- < h2 className = "mb-8 text-center text-2xl font-bold landing-text-strong" >
217- From database to browser
218- </ h2 >
219-
220- < div className = "grid gap-6 lg:grid-cols-2" >
221- { /* SQL example */ }
222- < div className = "overflow-hidden rounded-md border landing-code-bg" >
223- < div
224- className = "flex items-center gap-2 border-b px-4 py-2 text-xs font-semibold landing-code-header"
225- style = { { borderLeft : '3px solid #7aa2f7' } }
226- >
227- < Database className = "size-3.5" style = { { color : '#7aa2f7' } } />
228- SQL
229- </ div >
230- < div
231- className = "overflow-x-auto text-[13px] leading-relaxed [&_pre]:!m-0 [&_pre]:!rounded-none [&_pre]:!p-4"
232- style = { {
233- fontFamily :
234- 'ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace' ,
235- } }
236- dangerouslySetInnerHTML = { { __html : sqlHtml } }
237- />
238- </ div >
239-
240- { /* React example */ }
241- < div className = "overflow-hidden rounded-md border landing-code-bg" >
242- < div
243- className = "flex items-center gap-2 border-b px-4 py-2 text-xs font-semibold landing-code-header"
244- style = { { borderLeft : '3px solid #bb9af7' } }
245- >
246- < Component className = "size-3.5" style = { { color : '#bb9af7' } } />
247- React
248- </ div >
249- < div
250- className = "overflow-x-auto text-[13px] leading-relaxed [&_pre]:!m-0 [&_pre]:!rounded-none [&_pre]:!p-4"
251- style = { {
252- fontFamily :
253- 'ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace' ,
254- } }
255- dangerouslySetInnerHTML = { { __html : reactHtml } }
256- />
257- </ div >
258- </ div >
259- </ section >
260-
261266 { /* Footer */ }
262267 < footer
263268 className = "mt-auto border-t px-6 py-10 landing-card"
0 commit comments