react-code-dataset / Full-Stack-Spotify-Clone-Next-13.4-React-Stripe-Supabase-Tailwind /hooks /useLoadImage.ts
Download Full-Stack-Spotify-Clone-Next-13.4-React-Stripe-Supabase-Tailwind/hooks/useLoadImage.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 403 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/Full-Stack-Spotify-Clone-Next-13.4-React-Stripe-Supabase-Tailwind/hooks/useLoadImage.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/Full-Stack-Spotify-Clone-Next-13.4-React-Stripe-Supabase-Tailwind/hooks/useLoadImage.ts
-
curl -L -o useLoadImage.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/Full-Stack-Spotify-Clone-Next-13.4-React-Stripe-Supabase-Tailwind/hooks/useLoadImage.ts
403 Bytes
| import { useSupabaseClient } from "@supabase/auth-helpers-react"; | |
| import { Song } from "@/types"; | |
| const useLoadImage = (song: Song) => { | |
| const supabaseClient = useSupabaseClient(); | |
| if (!song) { | |
| return null; | |
| } | |
| const { data: imageData } = supabaseClient | |
| .storage | |
| .from('images') | |
| .getPublicUrl(song.image_path); | |
| return imageData.publicUrl; | |
| }; | |
| export default useLoadImage; | |