import Head from 'next/head' import Link from 'next/link' import ReactTimeAgo from 'react-time-ago' import { Loader } from '@/components/loader/loader' import { useState } from 'react' import { useGetPublicPostsQuery } from '@/services/inctagram.public-posts.service' export default function Home() { return ( <> Home | Instagram Client ) } function Content() { const [pageSize, setPageSize] = useState(4) const { data, isLoading, isError, error } = useGetPublicPostsQuery({ pageSize, }) if (isLoading) { return (
) } if (isError) { return
Error: {JSON.stringify(error, null, 2)}
} return (
{data?.items?.map(post => { return (
{post.userName}
{post.description &&
{post.description}
}
) })}
) }