Skip to content
Snippets Groups Projects

Testing

Merged Yusuf Akgül requested to merge testing into main
4 files
+ 10526
10644
Compare changes
  • Side-by-side
  • Inline
Files
4
"use client";
"use client"
import LoadingItem from "@/components/loading-item";
import { TryAgain } from "@/components/try-again";
import { Card } from "@/components/ui/card";
import { useGweets } from "../hooks/use-gweets";
import { InfiniteGweets } from "./infinite-gweets";
import LoadingItem from "@/components/loading-item"
import { TryAgain } from "@/components/try-again"
import { Card } from "@/components/ui/card"
import { useGweets } from "../hooks/use-gweets"
import { InfiniteGweets } from "./infinite-gweets"
export const Gweets = () => {
const {
data: gweets,
isLoading,
isError,
isSuccess,
isFetchingNextPage,
fetchNextPage,
hasNextPage,
} = useGweets({});
const {
data: gweets,
isLoading,
isError,
isSuccess,
isFetchingNextPage,
fetchNextPage,
hasNextPage,
} = useGweets({})
if (isLoading) {
return <LoadingItem />;
}
if (isLoading) {
return <LoadingItem /> // TODO make skeleton
}
if (isError) {
return <TryAgain />;
}
if (isError) {
return <TryAgain />
}
return (
<Card className="w-full h-full mt-6 p-2 xl:p-4 ">
<InfiniteGweets
gweets={gweets}
isSuccess={isSuccess}
isFetchingNextPage={isFetchingNextPage}
fetchNextPage={fetchNextPage}
hasNextPage={hasNextPage}
/>
</Card>
);
};
return (
<Card className="w-full h-full p-2 xl:p-4">
<InfiniteGweets
gweets={gweets}
isSuccess={isSuccess}
isFetchingNextPage={isFetchingNextPage}
fetchNextPage={fetchNextPage}
hasNextPage={hasNextPage}
/>
</Card>
)
}
Loading