import mock from '../mock'
import type { Menu } from '../types'
import brownie from '@/assets/pages/brownie.jpg'
import bruschetta from '@/assets/pages/bruschetta.jpg'
import caesarSalad from '@/assets/pages/caesar-salad.jpg'
import cheeseBurger from '@/assets/pages/cheese-burger.jpg'
import cheesecake from '@/assets/pages/cheesecake.jpg'
import cheesyFries from '@/assets/pages/cheesy-fries.jpg'
import chickenWings from '@/assets/pages/chicken-wings.jpg'
import coffee from '@/assets/pages/coffee.jpg'
import fruitSalad from '@/assets/pages/fruit-salad.jpg'
import icedTea from '@/assets/pages/iced-tea.jpg'
import lasagna from '@/assets/pages/lasagna.jpg'
import margheritaPizza from '@/assets/pages/margherita-pizza.jpg'
import roastedChicken from '@/assets/pages/roasted-chicken.jpg'
import softDrinks from '@/assets/pages/soft-drinks.jpg'
import sushi from '@/assets/pages/sushi.jpg'
import waffle from '@/assets/pages/waffle.jpg'

const menus: Menu[] = [
  {
    img: bruschetta,
    name: 'Classic Bruschetta',
    type: 'Appetizer',
    desc: 'Sliced baguette topped with diced tomatoes, fresh basil, garlic, and balsamic glaze.',
    price: 9.99,
    tax: 5,
  },
  {
    img: chickenWings,
    name: 'Chicken Wings',
    type: 'Appetizer',
    desc: 'Crispy chicken wings tossed in your choice of buffalo, barbecue, or mustard sauce.',
    price: 10.99,
    tax: 5,
  },
  {
    img: cheesyFries,
    name: 'Cheesy Fries',
    type: 'Appetizer',
    desc: 'Golden, crispy, and smothered in rich, melted cheddar. A flavor explosion!',
    price: 9.99,
    tax: 5,
  },
  {
    img: caesarSalad,
    name: 'Caesar Salad',
    type: 'Salad',
    desc: 'Romaine lettuce, croutons, parmesan cheese, and Caesar dressing.',
    price: 7.99,
    tax: 5,
  },
  {
    img: fruitSalad,
    name: 'Fruit Salad',
    type: 'Salad',
    desc: 'Refreshing fruit salad bursting with vibrant flavors, a healthy choice for a delightful treat.',
    price: 12.99,
    tax: 5,
  },
  {
    img: cheeseBurger,
    name: 'Cheese Burger',
    type: 'Main Course',
    desc: 'A juicy patty topped with cheese, lettuce, tomato, onion, and pickles on a brioche bun.',
    price: 8.5,
    tax: 5,
  },
  {
    img: margheritaPizza,
    name: 'Margherita Pizza',
    type: 'Main Course',
    desc: 'Tomato sauce, fresh mozzarella, basil, and olive oil on a thin crust pizza',
    price: 14.99,
    tax: 5,
  },
  {
    img: lasagna,
    name: 'Lasagna',
    type: 'Main Course',
    desc: 'The flat, wide lasagna noodles drape over themselves the buttery, lemony sauce.',
    price: 11.99,
    tax: 5,
  },
  {
    img: roastedChicken,
    name: 'Roasted Chicken',
    type: 'Main Course',
    desc: 'A coriander-infused brine tenderizes the chicken, that crispy dippable sauce.',
    price: 19.99,
    tax: 5,
  },
  {
    img: sushi,
    name: 'Sushi',
    type: 'Main Course',
    desc: 'Exquisite sushi rolls crafted with the freshest delightful blend of flavors in every bite.',
    price: 14.99,
    tax: 5,
  },
  {
    img: cheesecake,
    name: 'Cheesecake',
    type: 'Dessert',
    desc: 'Creamy New York-style cheesecake with a graham cracker crust.',
    price: 6.99,
    tax: 5,
  },
  {
    img: brownie,
    name: 'Brownie',
    type: 'Dessert',
    desc: 'Indulge in our rich, brownie – a chocolate lover\'s dream come true. Irresistibly decadent.',
    price: 9.99,
    tax: 5,
  },
  {
    img: waffle,
    name: 'Waffle',
    type: 'Dessert',
    desc: 'Delicious, crispy waffles topped with of fresh berries and drizzled in sweet maple syrup.',
    price: 7.99,
    tax: 5,
  },
  {
    img: softDrinks,
    name: 'Soft Drinks',
    type: 'Beverages',
    desc: 'A variety of soft drinks and sodas, A variety of soft drinks and sodas',
    price: 2.99,
    tax: 5,
  },
  {
    img: icedTea,
    name: 'Iced Tea',
    type: 'Beverages',
    desc: 'Freshly brewed iced tea, available sweetened or unsweetened.',
    price: 2.99,
    tax: 5,
  },
  {
    img: coffee,
    name: 'Coffee',
    type: 'Beverages',
    desc: 'Freshly brewed coffee with options for cream and sugar.',
    price: 2.99,
    tax: 5,
  },
]

mock.onGet('/restaurant/menu').reply(request => {
  const { filter = '' } = request.params || { filter: '' }
  let filterDb = menus

  if (filter) {
    filterDb = menus.filter(menu => {
      return menu.type === filter
    })
  }

  return [200, { menus: filterDb }]
})
