diff --git a/src/HealingResources/index.tsx b/src/HealingResources/index.tsx index 93fec62..807f5a3 100644 --- a/src/HealingResources/index.tsx +++ b/src/HealingResources/index.tsx @@ -1,6 +1,36 @@ +import React, { useEffect, useState } from 'react'; import { Button, View } from 'react-native'; +import supabase from '../supabase/createClient'; + +interface Resource { + summary: string; + [key: string]: any; +} export default function HealingResources() { + const [, setSummaries] = useState([]); + + useEffect(() => { + fetchData(); + }, []); + + const fetchData = async () => { + try { + const { data, error } = await supabase + .from('healing_resources') + .select('*'); + + if (error) { + console.error('Error fetching resources:', error); + return; + } + + setSummaries(data as Resource[]); + } catch (error) { + console.error('Error fetching data:', error); + } + }; + return (