import Head from "next/head";
import {
chakra,
Box,
Flex,
SimpleGrid,
Button,
Image,
Container,
Center,
} from "@chakra-ui/react";
import { useRouter } from "next/router";
import useSWR from "swr";
import Error from "components/error";
import { IoArrowBackOutline, IoCloudDownloadOutline } from "react-icons/io5";
import { BiLinkExternal } from "react-icons/bi";
import Link from "next/link";
import Show from "animations/show";
import Loader from "animations/loader";
import Hover from "animations/hover";
const fetcher = async (url) => {
const res = await fetch(url);
const data = await res.json();
if (res.status !== 200) {
throw new Error(data.message);
}
return data;
};
export default function Icon() {
const { query } = useRouter();
const { data, error } = useSWR(
() => query.id && `/api/search?id=${query.id}`,
fetcher
);
if (error) return