import { FC, useEffect, useState } from "react"
import { CartItemProps } from "../models/CartItem"
import axios from "axios";
export const CartItem:FC = () => {
const [pictures, setPictures] = useState<CartItemProps[]>([]);
useEffect(() => {
const fetchData = async () => {
const result = await axios(
'https://demo5043681.mockable.io/data ',
);
setPictures(result.data);
};
fetchData();
}, []);
return (
<div>
{Array.isArray(pictures) && pictures?.map(picture => (
<div>
{picture.id}
</div>
))}
</div>
)
}