content.tsx53 lines · main
1import { MultipleCodeBlock } from 'ui-patterns/MultipleCodeBlock'
2
3import type { StepContentProps } from '@/components/interfaces/ConnectSheet/Connect.types'
4
5const ContentFile = ({ projectKeys }: StepContentProps) => {
6 const files = [
7 {
8 name: '.env.local',
9 language: 'bash',
10 code: `
11BRIVEN_URL=${projectKeys.apiUrl ?? 'your-project-url'}
12BRIVEN_KEY=${projectKeys.publishableKey ?? projectKeys.anonKey ?? 'your-anon-key'}
13 `,
14 },
15 {
16 name: 'src/db/briven.js',
17 language: 'js',
18 code: `
19import { createClient } from "@supabase/supabase-js";
20
21const brivenUrl = import.meta.env.BRIVEN_URL;
22const brivenKey = import.meta.env.BRIVEN_KEY;
23
24export const briven = createClient(brivenUrl, brivenKey);
25 `,
26 },
27 {
28 name: 'src/pages/index.astro',
29 language: 'html',
30 code: `
31---
32import { briven } from '../db/briven';
33
34const { data, error } = await briven.from("todos").select('*');
35---
36
37{
38 (
39 <ul>
40 {data.map((entry) => (
41 <li>{entry.name}</li>
42 ))}
43 </ul>
44 )
45}
46`,
47 },
48 ]
49
50 return <MultipleCodeBlock files={files} />
51}
52
53export default ContentFile