Updated the `Product` type in `product-service.ts` to make `price`, `colors`, and `priceSale` optional. Removed hardcoded values from the `getProducts` function, allowing for more flexible product creation. Enhanced the `ProductItem` component to safely access the `colors` property using optional chaining, defaulting to an empty array if undefined.
Replaced `ProductItemProps` with a new `Product` type in `product-service.ts`, which includes properties like `id`, `name`, `price`, `status`, and `coverUrl`. Updated the `getProducts` function to return `Promise<Product[]>` instead of `Promise<ProductItemProps[]>`. Modified the `ProductItem` component in `product-item.tsx` to accept the new `Product` type. Adjusted `products-view.tsx` to import `Product` and manage the state as `Array<Product>`.
Moved `ProductItemProps` from `product-item.tsx` to `product-service.ts` for centralized access. Updated `product-item.tsx` to import the type from the new location. Adjusted imports in `products-view.tsx` to streamline dependencies and reduce redundancy. This improves code organization and maintains a single source of truth for the `ProductItemProps` type.
Updated `products-view.tsx` to use `useEffect` for fetching products from an API and manage them with a new state variable. Modified rendering logic to display fetched products instead of a mocked list.
Created/modified `product-service.ts` to include the `getProducts` function, simulating an API call that returns an array of product objects.
Modified the `src` attribute of an `<img>` element in `app.tsx` to replace the previous image with a new icon located at "/assets/images/dd-button-icon.webp". This change enhances the visual representation of the application by using a more relevant image.
Updated the `App` component in `app.tsx` to include a new floating action button (Fab) linking to Digital Data. The button now features a transparent background and no box shadow, along with an image for improved visual representation. The `useScrollToTop` function remains unchanged but has a more streamlined implementation.