This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect, useState } from "react"; | |
import axios from "axios"; | |
import { useCart } from "../utils/CartContext"; // Import useCart hook | |
import { toast } from "react-toastify"; | |
import "react-toastify/dist/ReactToastify.css"; | |
import { useAuth0 } from "@auth0/auth0-react"; // Import useAuth0 for user authentication | |
// Helper function to generate random integers | |
function getRandomInt(min, max) { | |
return Math.floor(Math.random() * (max - min + 1)) + min; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//2634. Filter Elements from Array | |
//filter function under the hood | |
/** | |
* @param {number[]} arr | |
* @param {Function} fn | |
* @return {number[]} | |
*/ | |
var filter = function(arr, fn) { | |
var a = []; | |
for(let i = 0; i < arr.length; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@tailwind base; | |
@tailwind components; | |
@tailwind utilities; | |
@layer components { | |
.card { | |
@apply | |
m-10 rounded-lg bg-white px-6 py-8 shadow-xl ring-1 ring-slate-900/5 dark:bg-black | |
} |