diff --git a/src/app/dashboardAdmin/page.tsx b/src/app/dashboardAdmin/page.tsx index 9318512..23de396 100644 --- a/src/app/dashboardAdmin/page.tsx +++ b/src/app/dashboardAdmin/page.tsx @@ -1,3 +1,56 @@ +import CardBarChart from "~/components/componetsDashboard/Cards/CardBarChart"; +import CardLineChart from "~/components/componetsDashboard/Cards/CardLineChart"; +import CardPageVisits from "~/components/componetsDashboard/Cards/CardPageVisits"; +import CardProfile from "~/components/componetsDashboard/Cards/CardProfile"; +import CardSettings from "~/components/componetsDashboard/Cards/CardSettings"; +import CardSocialTraffic from "~/components/componetsDashboard/Cards/CardSocialTraffic"; +import CardStats from "~/components/componetsDashboard/Cards/CardStats"; +import CardTable from "~/components/componetsDashboard/Cards/CardTable"; + +// import Navbar from "~/components/componetsDashboard/Navbars/IndexNavbar"; +import NavBar from "~/components/navBar/navBar"; +import Navbar from "../../components/componetsDashboard/Navbars/AdminNavbar"; +import Sidebar from "~/components/componetsDashboard/Sidebar/Sidebar"; +import CardUsers from "~/components/componetsDashboard/Cards/CardUsers" +import CardProducts from "~/components/componetsDashboard/Cards/CardProducts"; +import CardOrders from "~/components/componetsDashboard/Cards/CardOrders"; +import CardCategories from "~/components/componetsDashboard/Cards/CardCategories"; +import CardBrands from "~/components/componetsDashboard/Cards/CardBrands"; + + export default function landing() { - return

Hola soy DashboardAdmin

; + return ( + <> + + +
+ {/* */} +
+
Administración
+
+ + {/* USERS */} + + + {/* PRODUCTS */} + + + + + {/* ORDERS */} + + + {/* */} + SETTINGS: + {/* SETTINGS */} + + {/* */} + + {/* */} + {/* */} + {/* */} + {/* */} +
+ + ); } diff --git a/src/components/componetsDashboard/Cards/CardBarChart.jsx b/src/components/componetsDashboard/Cards/CardBarChart.jsx index e8ff067..a17ba07 100644 --- a/src/components/componetsDashboard/Cards/CardBarChart.jsx +++ b/src/components/componetsDashboard/Cards/CardBarChart.jsx @@ -101,7 +101,7 @@ export default function CardBarChart() { }, []); return ( <> -
+
diff --git a/src/components/componetsDashboard/Cards/CardBrands.tsx b/src/components/componetsDashboard/Cards/CardBrands.tsx new file mode 100644 index 0000000..012bca2 --- /dev/null +++ b/src/components/componetsDashboard/Cards/CardBrands.tsx @@ -0,0 +1,137 @@ +"use client"; +import { useEffect } from 'react'; +import PropTypes from 'prop-types'; + +// components +import SearchBar from '../SearchBar/SearchBar'; +import TableDropdown from '~/components/componetsDashboard/Dropdowns/TableDropdown'; + +import useDashboardAdminStore from '~/store/dashboardAdminStore'; + + +interface BrandsInterface { + id: number, + name: string, +}; + +const BRANDS: BrandsInterface[] = [ + { + id: 1, + name: "Audi" + }, + { + id: 2, + name: "Mitsubishi" + } +]; + + +type CardBrandsProps = { + color: string +}; + +export default function CardBrands({ color }: CardBrandsProps) { + + + // GLOBAL STORE: + const { brands, updateBrands }: any = useDashboardAdminStore(); + + + // LIFE CYCLES: + useEffect(() => { + updateBrands(BRANDS); + }, []); + + + // COMPONENT: + return ( + <> +
+
+
+
+

+ Marcas +

+ +
+
+
+
+ {/* Projects table */} + + + + + + + + + + { + brands.map((BRAND: any, idx: any) => ( + + + + + + )) + } + +
+ Id + + Nombre + + Acciones +
+ {BRAND.id} + + {BRAND.name} + + +
+
+
+ + ); +}; + +CardBrands.defaultProps = { + color: 'light', +}; + +CardBrands.propTypes = { + color: PropTypes.oneOf(['light', 'dark']), +}; diff --git a/src/components/componetsDashboard/Cards/CardCategories.tsx b/src/components/componetsDashboard/Cards/CardCategories.tsx new file mode 100644 index 0000000..8389e9d --- /dev/null +++ b/src/components/componetsDashboard/Cards/CardCategories.tsx @@ -0,0 +1,137 @@ +"use client"; +import { useEffect } from "react"; +import PropTypes from 'prop-types'; + +// components +import SearchBar from '../SearchBar/SearchBar'; +import TableDropdown from '~/components/componetsDashboard/Dropdowns/TableDropdown'; + +import useDashboardAdminStore from "~/store/dashboardAdminStore"; + + +interface CategoriesInterface { + id: number, + name: string, +}; + +const CATEGORIES: CategoriesInterface[] = [ + { + id: 1, + name: "Escape" + }, + { + id: 2, + name: "Pisos" + } +]; + + +type CardCategoriesProps = { + color: string +}; + +export default function CardCategories({ color }: CardCategoriesProps) { + + + // GLOBAL STORE: + const { categories, updateCategories }: any = useDashboardAdminStore(); + + + // LIFE CYCLES: + useEffect(() => { + updateCategories(CATEGORIES); + }, []); + + + // COMPONENT: + return ( + <> +
+
+
+
+

+ Categorías +

+ +
+
+
+
+ {/* Projects table */} + + + + + + + + + + { + categories.map((CATEGORY: any, idx: any) => ( + + + + + + )) + } + +
+ Id + + Nombre + + Acciones +
+ {CATEGORY.id} + + {CATEGORY.name} + + +
+
+
+ + ); +}; + +CardCategories.defaultProps = { + color: 'light', +}; + +CardCategories.propTypes = { + color: PropTypes.oneOf(['light', 'dark']), +}; \ No newline at end of file diff --git a/src/components/componetsDashboard/Cards/CardOrders.tsx b/src/components/componetsDashboard/Cards/CardOrders.tsx new file mode 100644 index 0000000..866d064 --- /dev/null +++ b/src/components/componetsDashboard/Cards/CardOrders.tsx @@ -0,0 +1,274 @@ +"use client"; +import { useEffect, useState } from 'react'; +import PropTypes from 'prop-types'; + +// components +import SearchBar from '../SearchBar/SearchBar'; +import TableDropdown from '~/components/componetsDashboard/Dropdowns/TableDropdown'; + +import useDashboardAdminStore from '~/store/dashboardAdminStore'; + + +interface OrdersInterface { + id: number, + orderNumber: number, + creationDate: string, + status: "cancelled" | "declined" | "approved" | "processing" | "inbound" | "delivered", + total: number, + list: { + product: string, + quantity: number, + value: number + }[], + payment: { + date: string, + method: "MercadoPago" | "cash", + state: "approved" | "declined" | "pending", + approvalNumber: number + }, + client: { + name: string, + emailAddress: string, + phoneNumber: string, + address: { + department: string, + locality: string, + neighborhood: string, + number: number, + references: string + } + } +}; + + +const ORDERS: OrdersInterface[] = [ + { + id: 1, + orderNumber: 123456789098, + creationDate: "01 November 2023", + status: "declined", + total: 2489900, + list: [{ + product: "product A", + quantity: 1, + value: 2489900 + }], + payment: { + date: "01 Novemeber 2023, 10:25 a.m. GMT-3", + method: "MercadoPago", + state: "approved", + approvalNumber: 123456789 + }, + client: { + name: "John", + emailAddress: "johndoe@gmail.com", + phoneNumber: "+54 123456789", + address: { + department: "Departamento", + locality: "Localidad", + neighborhood: "Barrio", + number: 123, + references: "Cerca al mall" + } + } + }, + { + id: 2, + orderNumber: 324567876543, + creationDate: "27 October 2023", + status: "delivered", + total: 1929900, + list: [{ + product: "product B", + quantity: 1, + value: 1929900 + }], + payment: { + date: "27 October 2023, 10:25 a.m. GMT-3", + method: "MercadoPago", + state: "approved", + approvalNumber: 987654321 + }, + client: { + name: "Doe", + emailAddress: "doejohn@gmail.com", + phoneNumber: "+57 123456789", + address: { + department: "Departamento", + locality: "Localidad", + neighborhood: "Vecindario", + number: 321, + references: "Cerca al mall" + } + } + } +]; + + +type CardOrdersProps = { + color: string +}; + +export default function CardOrders({ color }: CardOrdersProps) { + + + // GLOBAL STORE: + const { orders, updateOrders }: any = useDashboardAdminStore(); + + + // LOCAL STATES: + const [showDetails, setShowDetails] = useState(false); + + + // LIFECYCLES: + useEffect(() => { + updateOrders(ORDERS); + }, []) + + + // COMPONENT: + return ( + <> +
+
+
+
+

+ Pedidos +

+ +
+
+
+
+ + + + + + + + + + + + + { + orders.map((PRODUCT: any, idx: any) => ( + <> + + + + + + + + + { + showDetails ? ( +
+
+ Id + + Número de orden + + Fecha de creación + + Estado + + Total + + Acciones +
+ {PRODUCT.id} + + {PRODUCT.orderNumber} + + {PRODUCT.creationDate} + + {PRODUCT.status} + + {PRODUCT.total} + + {/* */} + +
+ + + + + +
+
+ ) : null + } + + )) + } + + +
+
+ + ); +}; + +CardOrders.defaultProps = { + color: 'light', +}; + +CardOrders.propTypes = { + color: PropTypes.oneOf(['light', 'dark']), +}; \ No newline at end of file diff --git a/src/components/componetsDashboard/Cards/CardProducts.tsx b/src/components/componetsDashboard/Cards/CardProducts.tsx new file mode 100644 index 0000000..fdd663d --- /dev/null +++ b/src/components/componetsDashboard/Cards/CardProducts.tsx @@ -0,0 +1,243 @@ +"use client"; +import { useEffect } from 'react'; +import PropTypes from 'prop-types'; + +// components +import SearchBar from '../SearchBar/SearchBar'; +import TableDropdown from '~/components/componetsDashboard/Dropdowns/TableDropdown'; + +import useDashboardAdminStore from '~/store/dashboardAdminStore'; + + +interface ProductsInterface { + id: number, + name: string, + picture: string, + category: string, + brand: string, + stock: number, + regularPrice: number, + salePrice: number +}; + +const PRODUCTS: ProductsInterface[] = [ + { + id: 1, + name: "Farola Hyundai I35 Elantra 2012 2016 Drl Tubo Led Proyector", + picture: "https://media.istockphoto.com/id/1337144146/vector/default-avatar-profile-icon-vector.jpg?s=612x612&w=0&k=20&c=BIbFwuv7FxTWvh5S3vB6bkT0Qv8Vn8N5Ffseq84ClGI=", + category: "Farolas", + brand: "Hyundai", + stock: 10, + regularPrice: 2489900, + salePrice: 2150910 + }, { + id: 2, + name: "Stop Hyundai i35 Elantra 2012-2016 Tubo Led+ Secuencial Giro", + picture: "https://media.istockphoto.com/id/1337144146/vector/default-avatar-profile-icon-vector.jpg?s=612x612&w=0&k=20&c=BIbFwuv7FxTWvh5S3vB6bkT0Qv8Vn8N5Ffseq84ClGI=", + category: "Farolas", + brand: "Audi", + stock: 7, + regularPrice: 2289900, + salePrice: 2060910 + }, { + id: 3, + name: "Stop Hyundai i35 Elantra 2012-2016 Tubo Led Full Led Ahumado", + picture: "https://media.istockphoto.com/id/1337144146/vector/default-avatar-profile-icon-vector.jpg?s=612x612&w=0&k=20&c=BIbFwuv7FxTWvh5S3vB6bkT0Qv8Vn8N5Ffseq84ClGI=", + category: "Farolas", + brand: "Mitsubishi", + stock: 3, + regularPrice: 1929900, + salePrice: 1736910 + } +]; + + +type CardProductsProps = { + color: string +}; + +export default function CardProducts({ color }: CardProductsProps) { + + + // GLOBAL STORE: + const { products, updateProducts }: any = useDashboardAdminStore(); + + + // LIFE CYCLES: + useEffect(() => { + updateProducts(PRODUCTS); + }, []); + + + // COMPONENT: + return ( + <> +
+
+
+
+

+ Productos +

+ +
+
+
+
+ + + + + + + + + + + + + + + { + products.map((PRODUCT: any, idx: any) => ( + + + + + + + + + + + )) + } + +
+ Id + + Nombre + + Categoría + + Marca + + Stock + + Precio regular + + Precio de oferta + + Acciones +
+ {PRODUCT.id} + + ... + + {PRODUCT.name} + + + {PRODUCT.category} + + {PRODUCT.brand} + + = 10 ? "text-[#00FF00]" : PRODUCT.stock >= 5 ? "text-[#FFC107]" : "text-[#FF0000]"}`}> {PRODUCT.stock} + +
+ {PRODUCT.regularPrice} +
+
+
+ {PRODUCT.salePrice} +
+
+ +
+
+
+ + ); +}; + +CardProducts.defaultProps = { + color: 'light', +}; + +CardProducts.propTypes = { + color: PropTypes.oneOf(['light', 'dark']), +}; \ No newline at end of file diff --git a/src/components/componetsDashboard/Cards/CardProfile.jsx b/src/components/componetsDashboard/Cards/CardProfile.jsx index c77881f..9835efb 100644 --- a/src/components/componetsDashboard/Cards/CardProfile.jsx +++ b/src/components/componetsDashboard/Cards/CardProfile.jsx @@ -71,7 +71,7 @@ export default function CardProfile() { e.preventDefault()} + // onClick={(e) => e.preventDefault()} > Show more diff --git a/src/components/componetsDashboard/Cards/CardTable.jsx b/src/components/componetsDashboard/Cards/CardTable.jsx index 0c5cb91..04103ed 100644 --- a/src/components/componetsDashboard/Cards/CardTable.jsx +++ b/src/components/componetsDashboard/Cards/CardTable.jsx @@ -23,7 +23,7 @@ export default function CardTable({ color }) { (color === 'light' ? 'text-blueGray-700' : 'text-white') } > - Card Tables + Orders
diff --git a/src/components/componetsDashboard/Cards/CardUsers.tsx b/src/components/componetsDashboard/Cards/CardUsers.tsx new file mode 100644 index 0000000..02ad492 --- /dev/null +++ b/src/components/componetsDashboard/Cards/CardUsers.tsx @@ -0,0 +1,210 @@ +"use client"; +import { useEffect } from 'react'; +import PropTypes from 'prop-types'; + +// components +import SearchBar from '../SearchBar/SearchBar'; +import TableDropdown from '~/components/componetsDashboard/Dropdowns/TableDropdown'; + +import useDashboardAdminStore from '~/store/dashboardAdminStore'; + + +interface UsersInterface { + id: number, + name: string, + picture: string, + emailAddress: string, + status: "active" | "blocked", + registerDate: string, +}; + +const USERS: UsersInterface[] = [ + { + id: 1, + name: "John", + picture: "https://media.istockphoto.com/id/1337144146/vector/default-avatar-profile-icon-vector.jpg?s=612x612&w=0&k=20&c=BIbFwuv7FxTWvh5S3vB6bkT0Qv8Vn8N5Ffseq84ClGI=", + status: "active", + emailAddress: "johndoe@gmail.com", + registerDate: "27/09/2023" + }, + { + id: 2, + name: "Doe", + picture: "https://media.istockphoto.com/id/1337144146/vector/default-avatar-profile-icon-vector.jpg?s=612x612&w=0&k=20&c=BIbFwuv7FxTWvh5S3vB6bkT0Qv8Vn8N5Ffseq84ClGI=", + status: "blocked", + emailAddress: "doejohn@hotmail.com", + registerDate: "21/07/2023" + } +]; + + +type CardUsersProps = { + color: string +}; + +export default function CardUsers({ color }: CardUsersProps) { + + + // GLOBAL STORE: + const { users, updateUsers }: any = useDashboardAdminStore(); + + + // LIFE CYCLES: + useEffect(() => { + updateUsers(USERS); + }, []); + + + // COMPONENT: + return ( + <> +
+
+
+
+

+ Usuarios +

+ +
+
+
+
+ {/* Projects table */} + + + + + + + + + + + + + { + users.map((USER: any, idx: any) => ( + + + + + + + + + )) + } + +
+ Id + + Nombre + + Correo electrónico + + Estado + + Fecha de registro + + Acciones +
+ {USER.id} + + ... + + {USER.name} + + + {USER.emailAddress} + + {USER.status === "active" ? "activado" : "bloqueado"} + +
+ {USER.registerDate} +
+
+
+
+
+
+
+ +
+
+
+ + ); +}; + +CardUsers.defaultProps = { + color: 'light', +}; + +CardUsers.propTypes = { + color: PropTypes.oneOf(['light', 'dark']), +}; \ No newline at end of file diff --git a/src/components/componetsDashboard/Dropdowns/IndexDropdown.js b/src/components/componetsDashboard/Dropdowns/IndexDropdown.js index 81d0d05..d02475b 100644 --- a/src/components/componetsDashboard/Dropdowns/IndexDropdown.js +++ b/src/components/componetsDashboard/Dropdowns/IndexDropdown.js @@ -1,6 +1,7 @@ "use client" import React from "react"; -import { Link } from "react-router-dom"; +import Link from "next/link"; +// import { Link } from "react-router-dom"; import { createPopper } from "@popperjs/core"; const IndexDropdown = () => { @@ -45,25 +46,25 @@ const IndexDropdown = () => { Admin Layout Dashboard Settings Tables Maps @@ -77,13 +78,13 @@ const IndexDropdown = () => { Auth Layout Login Register @@ -97,13 +98,13 @@ const IndexDropdown = () => { No Layout Landing Profile diff --git a/src/components/componetsDashboard/Dropdowns/PagesDropdown.js b/src/components/componetsDashboard/Dropdowns/PagesDropdown.js index aa5f57d..0a9eb15 100644 --- a/src/components/componetsDashboard/Dropdowns/PagesDropdown.js +++ b/src/components/componetsDashboard/Dropdowns/PagesDropdown.js @@ -45,7 +45,7 @@ const PagesDropdown = () => { Admin Layout { Dashboard { Settings { Tables { Auth Layout { Login { No Layout { Landing { +// prev name: NotificationDropdown +const TableDropdown = () => { // dropdown props const [dropdownPopoverShow, setDropdownPopoverShow] = React.useState(false); const btnDropdownRef = React.createRef(); @@ -68,4 +69,4 @@ const NotificationDropdown = () => { ); }; -export default NotificationDropdown; +export default TableDropdown; diff --git a/src/components/componetsDashboard/Navbars/AuthNavbar.js b/src/components/componetsDashboard/Navbars/AuthNavbar.js index 26e52b7..cd7e18a 100644 --- a/src/components/componetsDashboard/Navbars/AuthNavbar.js +++ b/src/components/componetsDashboard/Navbars/AuthNavbar.js @@ -15,7 +15,7 @@ export default function Navbar(props) {
Notus React diff --git a/src/components/componetsDashboard/Navbars/IndexNavbar.js b/src/components/componetsDashboard/Navbars/IndexNavbar.js index 7df697f..1df3e24 100644 --- a/src/components/componetsDashboard/Navbars/IndexNavbar.js +++ b/src/components/componetsDashboard/Navbars/IndexNavbar.js @@ -1,9 +1,11 @@ /*eslint-disable*/ +"use client" import React from "react"; -import { Link } from "react-router-dom"; +import Link from "next/link"; +// import { Link } from "react-router-dom"; // components -import IndexDropdown from "components/Dropdowns/IndexDropdown.js"; +import IndexDropdown from "../Dropdowns/IndexDropdown"; export default function Navbar(props) { const [navbarOpen, setNavbarOpen] = React.useState(false); @@ -13,7 +15,7 @@ export default function Navbar(props) {
Notus React @@ -39,7 +41,7 @@ export default function Navbar(props) { className="hover:text-blueGray-500 text-blueGray-700 px-3 py-4 lg:py-2 flex items-center text-xs uppercase font-bold" href="https://www.creative-tim.com/learning-lab/tailwind/react/overview/notus?ref=nr-index-navbar" > - {" "} + Docs diff --git a/src/components/componetsDashboard/SearchBar/SearchBar.tsx b/src/components/componetsDashboard/SearchBar/SearchBar.tsx new file mode 100644 index 0000000..4cee99c --- /dev/null +++ b/src/components/componetsDashboard/SearchBar/SearchBar.tsx @@ -0,0 +1,54 @@ +"use client"; +import { useState } from "react"; + +import { BiSearch } from "react-icons/bi"; +import useDashboardAdminStore from "~/store/dashboardAdminStore"; + + +type SearchBarProps = { + section: "user" | "product" | "brand" | "category" | "order"; +}; + + +function SearchBar({ section }: SearchBarProps) { + + + const [input, setInput] = useState(""); + + const { filterUsers, filterProducts, filterCategories, filterBrands, filterOrders }: any = useDashboardAdminStore(); + + const handleChange = (event: any) => { + setInput(event.target.value) + }; + + const filter = (input: string) => { + switch (section) { + case "user": filterUsers(input); break; + case "product": filterProducts(input); break; + case "category": filterCategories(input); break; + case "brand": filterBrands(input); break; + case "order": filterOrders(input); break; + default: break; + }; + }; + + + return ( +
+ filter(input)} + /> + handleChange(e)} + /> +
+ ) +}; + + +export default SearchBar; \ No newline at end of file diff --git a/src/components/componetsDashboard/Sidebar/Sidebar.js b/src/components/componetsDashboard/Sidebar/Sidebar.js index 0ea5725..9686d4a 100644 --- a/src/components/componetsDashboard/Sidebar/Sidebar.js +++ b/src/components/componetsDashboard/Sidebar/Sidebar.js @@ -7,6 +7,8 @@ import { useAuth } from '~/context/AuthContext'; import NotificationDropdown from '~/components/componetsDashboard/Dropdowns/NotificationDropdown.js'; import UserDropdown from '~/components/componetsDashboard/Dropdowns/UserDropdown.js'; +import { Images } from '~/assets/img'; +import Image from 'next/image'; import { Images } from '~/assets/img'; import { redirect } from 'next/navigation'; @@ -147,7 +149,7 @@ const handleLogout = (e) => { className={ 'text-xs uppercase py-3 font-bold block ' + (window.location.href.indexOf('/dashboardUser/settings') !== - -1 + -1 ? 'text-lightBlue-500 hover:text-lightBlue-600' : 'text-blueGray-700 hover:text-blueGray-500') } @@ -181,7 +183,7 @@ const handleLogout = (e) => { className={ 'fas fa-table mr-2 text-sm ' + (window.location.href.indexOf('/dashboardUser/Tables') !== - -1 + -1 ? 'opacity-75' : 'text-blueGray-300') } @@ -204,7 +206,7 @@ const handleLogout = (e) => { className={ 'fas fa-map-marked mr-2 text-sm ' + (window.location.href.indexOf('/dashboardUser/Maps') !== - -1 + -1 ? 'opacity-75' : 'text-blueGray-300') } diff --git a/src/store/dashboardAdminStore.ts b/src/store/dashboardAdminStore.ts new file mode 100644 index 0000000..0d14292 --- /dev/null +++ b/src/store/dashboardAdminStore.ts @@ -0,0 +1,102 @@ +import { create } from "zustand"; + + +const useDashboardAdminStore = create((set) => ({ + // USERS: + originalUsers: [], + users: [], + updateUsers: (data: any) => + set(() => ({ + users: data, + originalUsers: data + })), + filterUsers: (input: string) => { + set((state: any) => { + const filteredUsers = state.originalUsers.filter((object: any) => + object.name.toLowerCase().includes(input.toLowerCase()) + ); + return { + users: filteredUsers + } + }) + }, + + // PRODUCTS: + originalProducts: [], + products: [], + updateProducts: (data: any) => + set(() => ({ + products: data, + originalProducts: data + })), + filterProducts: (input: string) => { + set((state: any) => { + const filteredProducts = state.originalProducts.filter((object: any) => + object.name.toLowerCase().includes(input.toLowerCase()) + ); + return { + products: filteredProducts + } + }) + }, + + // CATEGORIES: + originalCategories: [], + categories: [], + updateCategories: (data: any) => + set(() => ({ + categories: data, + originalCategories: data + })), + filterCategories: (input: string) => { + set((state: any) => { + const filteredCategories = state.originalCategories.filter((object: any) => + object.name.toLowerCase().includes(input.toLowerCase()) + ); + return { + categories: filteredCategories + } + }) + }, + + // BRANDS: + originalBrands: [], + brands: [], + updateBrands: (data: any) => + set(() => ({ + brands: data, + originalBrands: data + })), + filterBrands: (input: string) => { + set((state: any) => { + const filteredBrands = state.originalBrands.filter((object: any) => + object.name.toLowerCase().includes(input.toLowerCase()) + ); + return { + brands: filteredBrands + } + }) + }, + + // ORDERS: + originalOrders: [], + orders: [], + updateOrders: (data: any) => + set(() => ({ + orders: data, + originalOrders: data + })), + filterOrders: (input: string) => { + set((state: any) => { + const filteredOrders = state.originalOrders.filter((object: any) => + object.orderNumber.toString().includes(input.toString()) + ); + return { + orders: filteredOrders + } + }) + }, +})); + + +export default useDashboardAdminStore; \ No newline at end of file