Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.2 kB
2
Indexable
Never
'use client'

import Image from 'next/image';
import { descriptionsSkins } from '@/app/home/page';
import { context } from '@/Context';
import { useContext, useEffect } from 'react';
import { useParams } from 'next/navigation';
import { GetStaticProps } from 'next';

export default function Skin() {
  // const { id } = useParams();
  const data = useContext(context);
  
  // const retrieveSkins = () => {
  //   const skin = data?.descriptions.filter((item) => item.classid === id);

  //   console.log(skin);

  //   const { name, icon_url_large, market_name }: descriptionsSkins = skin!;

  //   return skin;
  // }
  
  return (
    <div className="w-screen h-screen flex justify-center items-center">
      <div
      className="w-60 p-6 border rounded flex flex-col"
      >
        {id}
        <h1>{skin![0].name}</h1>
        <Image
          src={`https://steamcommunity-a.akamaihd.net/economy/image/${skin![0].icon_url_large}/200fx200f`}
          alt={`skin ${skin![0].market_name}`}
          width={200}
          height={200}
        />
      </div>
    </div>
  )
}

export const getStaticProps: GetStaticProps<any, { id: string }> = async ({
  params,
}) => { 
  
}