import { useQuery } from "@tanstack/react-query"; import { useState } from "react"; interface InstagramPost { id: string; media_type: 'IMAGE' | 'VIDEO' | 'CAROUSEL_ALBUM'; media_url: string; permalink: string; caption?: string; timestamp: string; } export function PhotoGallery() { const [showAllPosts, setShowAllPosts] = useState(false); const { data: posts, isLoading, error } = useQuery({ queryKey: ['/api/instagram-feed'], staleTime: 1000 * 60 * 30, // Cache for 30 minutes }); const displayPosts = showAllPosts ? posts : posts?.slice(0, 6); return (

Follow My Journey

{isLoading && (
{[1, 2, 3, 4, 5, 6].map((index) => (
))}
)} {error && (

Follow me on Instagram for daily inspiration, movement tips, and behind-the-scenes content from my classes.

Visit Instagram
)} {posts && posts.length > 0 && (
{posts.length > 6 && (
)}
)}
); }