import * as ScrollArea from "@radix-ui/react-scroll-area"; import { Container, Flex, Heading, Separator } from "@radix-ui/themes"; import { useQuery } from "@tanstack/react-query"; import { useTranslation } from "react-i18next"; import { GetRandomPostsRow } from "../../@types/PostTypes"; import { axiosLocalhost } from "../../api/axios/axios"; import PostCard from "./PostCard/PostCard"; const LIMIT = 10; export default function RandomPostsPage() { const {t} = useTranslation() const { data, refetch } = useQuery({ queryKey: ["random_posts_key"], queryFn: async () => { try { const response = await axiosLocalhost.get( `/posts/random?limit=${LIMIT}` ); return response.data as GetRandomPostsRow[]; } catch (error) { console.log(`Something went wrong`); } return []; }, }); return ( <> {t("discover")} {data?.map((post, i) => { return ( ); })} {/* */} {/* */} ); }