Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/cactussia/cactusia
Browse files Browse the repository at this point in the history
  • Loading branch information
tchisama committed Nov 20, 2023
2 parents ab86acb + 97cef63 commit 3a1c5d0
Show file tree
Hide file tree
Showing 12 changed files with 179 additions and 137 deletions.
128 changes: 64 additions & 64 deletions .firebase/hosting.ZGlzdA.cache
Original file line number Diff line number Diff line change
Expand Up @@ -2,68 +2,68 @@ OGP.jpg,1690234910817,e5fc3fd1a2d17ab7564b38252f588243bd5906399770046e67b52fe7dc
profiles.jsonld,1696260471943,72d202f302e435014f86518399c15599dbb2ece6d2d408da83ed4ec5e338f6b9
robots.txt,1696260471944,13af1752891e481baa1b48fe97b1b53a91fbbbf0b3820bc0c76f2eae18414e1b
sitemap.xml,1696260471944,cd8738b24b888253d5841ad06c7c67964b7c39d0ff9c82d88b213b3eb3c1a86c
index.html,1696858271313,3f8602f33998c283cd129ff14f39a3de20f5668a6d89525052eeb579087bffc7
assets/cactus-dd4d32f9.png,1696858271289,fed26160ec94ef911cd1380b98bc4b45196714d32ada3694aaba75dcc77bb8ff
assets/cactusdemo-b371cd33.png,1696858271289,2fe3ad6e0d5a19a8a4baf75f584e644d4beecbe99a3c71317fca8c500de713c3
assets/handmade-c34a9dfb.png,1696858271285,ad87f3209855ee3411c2ea4c38dea47c436d37b47f826970890a18b184ff3a4f
assets/handmadedark-c6451d5a.png,1696858271289,3d34438c29567f3e3a0107b21e9e3e20491aa0919a99c9c40958dc8fe8f8c188
assets/index-30c2aeee.css,1696858271313,e73e82442a5abe0bfa397b2b7aa71cb4006336850e5eb815d5b57fce9444c012
assets/13-77bbf053.png,1696858271257,844fee634b9153f474203342c5d22bacb23039ea5b7ff3318e279a815faa3847
assets/11-19cf8c1b.png,1696858271257,d348fd39ad788af5f1e594a15996a742d7e6c6cfb8967fa2a8e4dc71c3c6ab16
assets/5-60f03eed.png,1696858271257,2eba92a262959afaa5d71b9ebfe4da32a43a3d7e542da433ae0fca4d35ed4faa
assets/7-af69f007.png,1696858271257,50dded210d7bbc354223ecdcb9a412e10501d944d78649c36434e37ca3015cd8
assets/greennoise-d2c612f1.png,1696858271273,64f3578300ef010fdab61e95759b9edb2aacbd109a68700b209052cc5c284f95
assets/8-e8c2c6d2.png,1696858271257,15ee43122b5449b1447536e2c0bce3a216bfccc38fd3158879f3c4a2ce40ede4
assets/4-b641cae8.png,1696858271261,7d6c79a2e3b8f1c947e5affd11e1f6d98e13122d1ca3213fe874f6441656d173
assets/12-71e499b7.png,1696858271261,7daaeb7f1a6af9e8e916d1c801e746fc83401ac32d731b4fdb904df20442b9ad
assets/logo-100ec30a.jpeg,1696858271253,a255e73429cdac24f65e3c70959748a50c6631f9641b56f8f98005302468ef88
index.html,1696863864843,025df8d1dc5d7305fb3f715796476706b15bb7f491178b7bb4abe4320dc41e42
assets/cactusdemo-b371cd33.png,1696863864809,2fe3ad6e0d5a19a8a4baf75f584e644d4beecbe99a3c71317fca8c500de713c3
assets/cactus-dd4d32f9.png,1696863864842,fed26160ec94ef911cd1380b98bc4b45196714d32ada3694aaba75dcc77bb8ff
assets/handmadedark-c6451d5a.png,1696863864841,3d34438c29567f3e3a0107b21e9e3e20491aa0919a99c9c40958dc8fe8f8c188
assets/handmade-c34a9dfb.png,1696863864826,ad87f3209855ee3411c2ea4c38dea47c436d37b47f826970890a18b184ff3a4f
assets/index-5cc0706f.css,1696863864842,501d7129008ec4583df04d2c5fa25ce4d62dff11ed3dfec38aca2c2aea64c30a
assets/13-77bbf053.png,1696863864809,844fee634b9153f474203342c5d22bacb23039ea5b7ff3318e279a815faa3847
assets/11-19cf8c1b.png,1696863864809,d348fd39ad788af5f1e594a15996a742d7e6c6cfb8967fa2a8e4dc71c3c6ab16
assets/5-60f03eed.png,1696863864809,2eba92a262959afaa5d71b9ebfe4da32a43a3d7e542da433ae0fca4d35ed4faa
assets/7-af69f007.png,1696863864809,50dded210d7bbc354223ecdcb9a412e10501d944d78649c36434e37ca3015cd8
assets/greennoise-d2c612f1.png,1696863864809,64f3578300ef010fdab61e95759b9edb2aacbd109a68700b209052cc5c284f95
assets/8-e8c2c6d2.png,1696863864809,15ee43122b5449b1447536e2c0bce3a216bfccc38fd3158879f3c4a2ce40ede4
assets/4-b641cae8.png,1696863864809,7d6c79a2e3b8f1c947e5affd11e1f6d98e13122d1ca3213fe874f6441656d173
assets/12-71e499b7.png,1696863864809,7daaeb7f1a6af9e8e916d1c801e746fc83401ac32d731b4fdb904df20442b9ad
assets/logo-100ec30a.jpeg,1696863864801,a255e73429cdac24f65e3c70959748a50c6631f9641b56f8f98005302468ef88
scripts/gtm.js,1695234554992,6ff50448333ecda8f4419d8f1007907a00dd864fcd7a7b7cdafd808d4666ecd1
assets/cactusSticker-3bc5486a.png,1696858271289,d5be4fff31e38cada4d638b1c9ab26965f128e9f525ebaa664e5cadbcfc06bca
assets/trowel-2ae9b367.png,1696858271293,81110b3f533b7affa23d6e293dfe8de7115f59438cdefedf1abd9bf7511a26e3
assets/shadow-82bcb29a.png,1696858271289,8ca7ba6ccc399018c6e940c5584f21f79d097a73e92327555e91fd2d52e2a261
assets/10-c88f228e.png,1696858271257,b9e42929b000791b4a096fada92b442a1ec787dfee19610fb40822ec4fe0a395
assets/14-580c5e72.png,1696858271257,2f86f0a1a6cd7f0ca46e76b66237e21eee8a653ced0018e70924927d9e186b6a
assets/4-07e4c9f6.png,1696858271257,0571a9708504325fe42b685c66c95991b460d20107658bbc64a705c444c8e730
assets/9-0317d7a4.png,1696858271257,57fe57299d17ebbc8530c6e9f3e7d1d5cca97610fd2dad342fb63aeffa372e51
assets/2-a6a4cc5a.png,1696858271257,2ce44bce41dcf139cac7f549cc94bf46bb84781ca9c54ad06911986c8f0ea38f
assets/noise-cb51292b.png,1696858271273,9b4ae1bb4be069ea4f68801c72658bc93f60a598f39875050444cafc0c0a135e
assets/6-af1e4a6c.png,1696858271257,3ff566354387124f109bb1f68b28ff6a3ffb5ccd4a30f7db0635cea4c1bf4302
assets/unboxing-1de23873.gif,1696858271293,406bff33ef875d102752d839ed83aa81d0f85513fb77363be921ed5f23b02810
assets/3-44bea25d.png,1696858271253,540da89510da3a3a7f94679ba590eeb98a7ccb6951788dbad1e120f755f8c320
assets/1-9ad656f0.png,1696858271257,9c86b7b749eefb115bb1111a68452f25497260d097c8b6e1b56d7d26351b9a8c
assets/door-2afbf71c.gif,1696858271297,bcd69a70942e3aa072509481619bcb67b82ccab47c2af2e7909e8d7baa742223
assets/7-5ff858d5.png,1696858271273,4ec619deb3962463f430dab00a1193e6c3553ecae8d422912df920a47980b46f
assets/signposts-17e2e11b.gif,1696858271285,dddc8e259dce2737772b7031d989c2a292aa0fda0666d0a423237946e01c5f24
assets/5-a393f37d.png,1696858271257,7d9fb20cc325da380d5a9d21a2edf7a5e0e759fb0944b7d5fb100c71ee9eadfc
assets/1-b0f5ed3a.png,1696858271257,38f8c7560ab652a0cd3a72d2cd7e9e662b3fda570febdcfcad4a91a7f53cf77d
assets/14-8060ce07.png,1696858271269,a917f2f25394197c4f3d227d8d4437b2b7af2d3f20746482fae0998dfcdabe81
assets/27-4e627962.png,1696858271279,ed89d654e238415273ce6caca95d092b1951eb5d95fae3b0731e9c00e5823cc8
assets/6-8b76f627.png,1696858271261,05ae5193acf7689f64cb17558a5bcd64502d92ab38ab72507948ae65e0eb508c
assets/11-8de67d64.png,1696858271273,0dd49abfa3122656f9e5e44643c355355ad7d53e3e61e96273b719f6a2a4c91d
assets/28-9813df10.png,1696858271293,7149db002d48dead110f8151c2d71e425f4fa89848915eea7a4c07ff8d9a4066
assets/12-db666e5e.png,1696858271273,a3586f73095f76bf813fb8117f3003010b7cc51f7889df6ec2388d4dd63c0855
assets/15-54221ed6.png,1696858271273,b2a8659c1827a524593050f145d6a112b43b4b9fd05891297c5348cfa4870e45
assets/9-66164fe4.png,1696858271273,377d92f800c6ba030e0d5cad8e3c223e9123f8c4b557bf062ef95377b2b11245
assets/13-d457d27e.png,1696858271273,44118583a244f6d7404e7410c161715656d7b1dddcfaaf7d2d6c6a9cc56f5e37
assets/10-19650235.png,1696858271273,c720899bd6f87c8cd46bc9407c75891c9e02eba6089a04d11d4feee24209e517
assets/22-ec476c4d.png,1696858271281,739e7f0946e6760159dee15841b4bf36f4d32fd447ee668bd612c000391e1210
assets/route-c69e4aa5.gif,1696858271293,c7fb261dcde99bc588033e44b32e569081b5b91702c985622abb25feb20d1e06
assets/8-55bdcebe.png,1696858271273,95de6b82297939f07e380034716a60c33267dc3a23c767bda26fc5ce94e84438
assets/3-a44bcb3a.png,1696858271273,854f83734d003eae0992d3cb8824a2aa32ced2ddb0f57921399ccbd66a29c9f3
assets/16-1284a87e.png,1696858271273,277bcfc9ab82521dac0d2a9b8f7fc10a88136fa462a025af8dd1c3c9beff6290
assets/2-785b878b.png,1696858271261,101b71573c2b1e4a7e16b2aa68552ec443520788e445e10c8fde219ed41a3a76
assets/24-c60b6863.png,1696858271289,360f622d3a65813cd0e4e149931d92d3815e8020c16438b9d3324b4e908c7c57
assets/25-fd31f68c.png,1696858271289,ccb6e131de28c992bd0a75dd5464b742d6a2582a28b7a7ddb9cb9cf9d28bc5ff
assets/26-4f656bfe.png,1696858271289,187aeb098722917e1495c6354adadf7e1a0c3a685c2a9eb39866f2487546b1cb
assets/20-5938ce78.png,1696858271281,5a8e9873dd05fdb4995ef82482086baa978a29e7f39b10921860b51e0cb01a43
assets/21-409dc65b.png,1696858271281,139a429742f00746f970871a6e4ff81390891bc4d1d4418e20000819b1fa7ffd
assets/warning-3e7827c4.gif,1696858271289,006f22a8e092636f035e74d5079eac893f38f30fe397ebacf2fc806a68a6c50e
assets/17-aa1e2503.png,1696858271279,c571303758798fcc8152540662b53d2c96d14a7a7ebd9435e4bd4d40e158096b
assets/19-6685025b.png,1696858271279,abaec53549930a6cc49c8c7fa2c8ef91f8d26dfa92d1a30b3fd72255547a117b
assets/18-e812812e.png,1696858271277,58971e14d9fe0c7253ce4be5df9a654167d04a023a03e46922db79a05eacaa93
assets/23-c5f3f06a.png,1696858271285,a084be2515e109b9a51a50fa8ea1add21a21738bf7c3784fa3050987ebf0bac6
assets/package-3bc832e0.gif,1696858271313,ef2679afcb009227846632c8cc9a05cbf94ac200d512c9afc2b5ba68430276b7
assets/index-27583546.js,1696858271313,47e493a8be72a5e3b7d1740be3b4580b17a0b5081a37f94582ac503eebd98cb7
assets/delivery-0042bed0.gif,1696858271297,24977035b2f57eb2834913386b365b2046e2d11e9ee591b22b2ee74b56e8659c
assets/delivery-truck-0a34240a.gif,1696858271297,fb5e519a7fa1b4cefc619a47398aa8fcf8042698b531c28d52416b7f3861ef4d
assets/delivery-scooter-e25551a0.gif,1696858271301,e3ff8aeb32d25ee21f86d0806cfb86961efc944625def66ce24e703e9a802272
assets/cactusSticker-3bc5486a.png,1696863864809,d5be4fff31e38cada4d638b1c9ab26965f128e9f525ebaa664e5cadbcfc06bca
assets/trowel-2ae9b367.png,1696863864809,81110b3f533b7affa23d6e293dfe8de7115f59438cdefedf1abd9bf7511a26e3
assets/shadow-82bcb29a.png,1696863864826,8ca7ba6ccc399018c6e940c5584f21f79d097a73e92327555e91fd2d52e2a261
assets/10-c88f228e.png,1696863864809,b9e42929b000791b4a096fada92b442a1ec787dfee19610fb40822ec4fe0a395
assets/14-580c5e72.png,1696863864809,2f86f0a1a6cd7f0ca46e76b66237e21eee8a653ced0018e70924927d9e186b6a
assets/2-a6a4cc5a.png,1696863864809,2ce44bce41dcf139cac7f549cc94bf46bb84781ca9c54ad06911986c8f0ea38f
assets/4-07e4c9f6.png,1696863864796,0571a9708504325fe42b685c66c95991b460d20107658bbc64a705c444c8e730
assets/9-0317d7a4.png,1696863864809,57fe57299d17ebbc8530c6e9f3e7d1d5cca97610fd2dad342fb63aeffa372e51
assets/noise-cb51292b.png,1696863864809,9b4ae1bb4be069ea4f68801c72658bc93f60a598f39875050444cafc0c0a135e
assets/6-af1e4a6c.png,1696863864809,3ff566354387124f109bb1f68b28ff6a3ffb5ccd4a30f7db0635cea4c1bf4302
assets/unboxing-1de23873.gif,1696863864826,406bff33ef875d102752d839ed83aa81d0f85513fb77363be921ed5f23b02810
assets/3-44bea25d.png,1696863864809,540da89510da3a3a7f94679ba590eeb98a7ccb6951788dbad1e120f755f8c320
assets/1-9ad656f0.png,1696863864799,9c86b7b749eefb115bb1111a68452f25497260d097c8b6e1b56d7d26351b9a8c
assets/door-2afbf71c.gif,1696863864809,bcd69a70942e3aa072509481619bcb67b82ccab47c2af2e7909e8d7baa742223
assets/7-5ff858d5.png,1696863864799,4ec619deb3962463f430dab00a1193e6c3553ecae8d422912df920a47980b46f
assets/5-a393f37d.png,1696863864799,7d9fb20cc325da380d5a9d21a2edf7a5e0e759fb0944b7d5fb100c71ee9eadfc
assets/signposts-17e2e11b.gif,1696863864826,dddc8e259dce2737772b7031d989c2a292aa0fda0666d0a423237946e01c5f24
assets/1-b0f5ed3a.png,1696863864809,38f8c7560ab652a0cd3a72d2cd7e9e662b3fda570febdcfcad4a91a7f53cf77d
assets/14-8060ce07.png,1696863864799,a917f2f25394197c4f3d227d8d4437b2b7af2d3f20746482fae0998dfcdabe81
assets/27-4e627962.png,1696863864809,ed89d654e238415273ce6caca95d092b1951eb5d95fae3b0731e9c00e5823cc8
assets/6-8b76f627.png,1696863864799,05ae5193acf7689f64cb17558a5bcd64502d92ab38ab72507948ae65e0eb508c
assets/11-8de67d64.png,1696863864802,0dd49abfa3122656f9e5e44643c355355ad7d53e3e61e96273b719f6a2a4c91d
assets/28-9813df10.png,1696863864809,7149db002d48dead110f8151c2d71e425f4fa89848915eea7a4c07ff8d9a4066
assets/12-db666e5e.png,1696863864802,a3586f73095f76bf813fb8117f3003010b7cc51f7889df6ec2388d4dd63c0855
assets/15-54221ed6.png,1696863864802,b2a8659c1827a524593050f145d6a112b43b4b9fd05891297c5348cfa4870e45
assets/9-66164fe4.png,1696863864802,377d92f800c6ba030e0d5cad8e3c223e9123f8c4b557bf062ef95377b2b11245
assets/13-d457d27e.png,1696863864802,44118583a244f6d7404e7410c161715656d7b1dddcfaaf7d2d6c6a9cc56f5e37
assets/10-19650235.png,1696863864802,c720899bd6f87c8cd46bc9407c75891c9e02eba6089a04d11d4feee24209e517
assets/22-ec476c4d.png,1696863864809,739e7f0946e6760159dee15841b4bf36f4d32fd447ee668bd612c000391e1210
assets/route-c69e4aa5.gif,1696863864825,c7fb261dcde99bc588033e44b32e569081b5b91702c985622abb25feb20d1e06
assets/8-55bdcebe.png,1696863864802,95de6b82297939f07e380034716a60c33267dc3a23c767bda26fc5ce94e84438
assets/3-a44bcb3a.png,1696863864802,854f83734d003eae0992d3cb8824a2aa32ced2ddb0f57921399ccbd66a29c9f3
assets/16-1284a87e.png,1696863864803,277bcfc9ab82521dac0d2a9b8f7fc10a88136fa462a025af8dd1c3c9beff6290
assets/2-785b878b.png,1696863864801,101b71573c2b1e4a7e16b2aa68552ec443520788e445e10c8fde219ed41a3a76
assets/24-c60b6863.png,1696863864809,360f622d3a65813cd0e4e149931d92d3815e8020c16438b9d3324b4e908c7c57
assets/25-fd31f68c.png,1696863864809,ccb6e131de28c992bd0a75dd5464b742d6a2582a28b7a7ddb9cb9cf9d28bc5ff
assets/26-4f656bfe.png,1696863864809,187aeb098722917e1495c6354adadf7e1a0c3a685c2a9eb39866f2487546b1cb
assets/20-5938ce78.png,1696863864826,5a8e9873dd05fdb4995ef82482086baa978a29e7f39b10921860b51e0cb01a43
assets/warning-3e7827c4.gif,1696863864809,006f22a8e092636f035e74d5079eac893f38f30fe397ebacf2fc806a68a6c50e
assets/17-aa1e2503.png,1696863864803,c571303758798fcc8152540662b53d2c96d14a7a7ebd9435e4bd4d40e158096b
assets/21-409dc65b.png,1696863864809,139a429742f00746f970871a6e4ff81390891bc4d1d4418e20000819b1fa7ffd
assets/19-6685025b.png,1696863864803,abaec53549930a6cc49c8c7fa2c8ef91f8d26dfa92d1a30b3fd72255547a117b
assets/18-e812812e.png,1696863864803,58971e14d9fe0c7253ce4be5df9a654167d04a023a03e46922db79a05eacaa93
assets/23-c5f3f06a.png,1696863864809,a084be2515e109b9a51a50fa8ea1add21a21738bf7c3784fa3050987ebf0bac6
assets/package-3bc832e0.gif,1696863864826,ef2679afcb009227846632c8cc9a05cbf94ac200d512c9afc2b5ba68430276b7
assets/index-4216e973.js,1696863864843,d099604243357a0ed907541b87d7b5549604e82472595f82f9141578c54f637b
assets/delivery-0042bed0.gif,1696863864826,24977035b2f57eb2834913386b365b2046e2d11e9ee591b22b2ee74b56e8659c
assets/delivery-truck-0a34240a.gif,1696863864826,fb5e519a7fa1b4cefc619a47398aa8fcf8042698b531c28d52416b7f3861ef4d
assets/delivery-scooter-e25551a0.gif,1696863864842,e3ff8aeb32d25ee21f86d0806cfb86961efc944625def66ce24e703e9a802272
Binary file added src/assets/potsImages/29.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/assets/potsImages/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import pot25 from "./25.png"
import pot26 from "./26.png"
import pot27 from "./27.png"
import pot28 from "./28.png"
import pot29 from "./29.png"
export default [
pot1,
pot2,
Expand Down Expand Up @@ -55,4 +56,5 @@ export default [
pot26,
pot27,
pot28,
pot29,
];
49 changes: 33 additions & 16 deletions src/components/OrdersTabel.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import { useState, useMemo, useEffect } from 'react';
import { useState, useMemo, useEffect, useCallback } from 'react';
import ArrowBackIcon from '@mui/icons-material/ArrowForward';
import { WhatsApp } from "@mui/icons-material";

import {
doc,deleteDoc, onSnapshot, orderBy, query, where
} from "firebase/firestore"
import { doc,deleteDoc, onSnapshot, orderBy, query, where } from "firebase/firestore"
import { colRef, db } from '../firebase.js';
import StateBtn from './StateBtn.jsx';

import { utils, writeFileXLSX, writeXLSX } from 'xlsx';
import { WhatsappMessageConfirmation, dateFormater, orderTrackingStatus, phoneFormater } from '../utils/index.js';
import { WhatsappMessageConfirmation, dateFormater, orderTrackingStatus, phoneFormater, toXlsx } from '../utils/index.js';
import { Box } from '@mui/material';
import { DataGrid } from '@mui/x-data-grid';

Expand Down Expand Up @@ -60,13 +57,6 @@ export default function CustomizedTables({cat,cats,setCat,setOrder}) {
return () => clearTimeout(timeout);
}, [ordersUpdated])

const exportExcel = ()=>{
var wb = utils.book_new(),
ws = utils.json_to_sheet(orders.filter(o=>o.checked).map(o=>{return({name:o.name,Lastname:o.lastName,address:o.address,city:o.city,number:o.number,price:o.price,comment:"thanks....",size:"small"})}));
utils.book_append_sheet(wb,ws,"myfile")
writeFileXLSX(wb,"myfileName.xlsx")
}

const deleteOrders = () => {
if(confirm(`Are You Sure You Want To Delete These Orders?: ${selection.join(",\n")}`)){
setOrders(orders.filter(order => {
Expand Down Expand Up @@ -96,9 +86,9 @@ export default function CustomizedTables({cat,cats,setCat,setOrder}) {
headerClassName: "bg-white invert",
renderHeader:(params) => <h1 className='w-full bg-white text-black font-bold '>Last Name</h1>,
},
{ field: 'number', headerName: 'Number', width: 130,
{ field: 'number', headerName: 'Phone Number', width: 130,
headerClassName: "bg-white invert",
renderHeader:(params) => <h1 className='w-full bg-white text-black font-bold '>Number</h1>,
renderHeader:(params) => <h1 className='w-full bg-white text-black font-bold '>Phone Number</h1>,
},
{ field: 'city', headerName: 'City', width: 130,
headerClassName: "bg-white invert",
Expand Down Expand Up @@ -157,6 +147,33 @@ export default function CustomizedTables({cat,cats,setCat,setOrder}) {
renderCell: ({ row }) => <button onClick={()=>setOrder(row)} className='p-1 px-4 bg-gray-300 rounded-full'><ArrowBackIcon/></button>
},
], [orders, selection, update, setUpdate, cats]);

const exportToXLSX = useCallback(() => {
// check if there is a selected rows export the selected rows else export all rows
const data = (selection.length > 0 ? selection : orders).map((order) => {
// formating the data to be readable
return {
"Order ID": order.id,
"First Name": order.name,
"Last Name": order.lastName,
"Phone Number": order.number,
"City": order.city,
"Full Address": order.address,
"Items": order.itemsCount,
"Price": order.price + " Dh",
"State": order.state,
"Order Date": order.date,
// "Order Date": `=Date(${order.date.split("/")[2]},${order.date.split("/")[0]},${order.date.split("/")[1]})`,
"Order Time": new Date(order.createdAt?.seconds * 1000).toLocaleTimeString("en-US",{hour12: false}),
// "Order Time": `=Time(${new Date(order.createdAt?.seconds * 1000).toLocaleTimeString("en-US",{hour12: false}).split(":").join(",")})`,
"Readable Date": order.formatedDate,
}
});

// exporting the data to xlsx
return toXlsx(data, `${cats[cat]}-catusia-orders`);

}, [orders, selection, cat, cats]);

return (
<>
Expand All @@ -172,7 +189,7 @@ export default function CustomizedTables({cat,cats,setCat,setOrder}) {
<Box className="h-full w-fit max-w-full min-h-[250px] max-h-screen bg-slate-100 font-semibold p-4 flex flex-col gap-4 print:hidden overflow-x-auto">
<div className='flex justify-center items-center gap-5'>
<div className='flex gap-2'>
<button onClick={exportExcel} className='bg-black rounded-full px-8 py-2 text-white my-2 drop-shadow-lg transition-all'>Export Excel</button>
<button onClick={exportToXLSX} className='flex justify-center items-center bg-black rounded-full px-8 py-2 text-white my-2 drop-shadow-lg transition-all cursor-pointer'><i className="fi fi-sr-file-excel flex justify-center items-center mr-2"></i> Export {selection.length > 0 ? "Selected" : "All"}</button>
<button onClick={deleteOrders} className={`${selection.length > 0 ? "scale-100 opacity-100" : "scale-0 opacity-0"} bg-red-700 rounded-full px-8 py-2 drop-shadow-lg text-white my-2 transition-all`}>Delete</button>
</div>

Expand Down
2 changes: 1 addition & 1 deletion src/components/Reviews/Rating.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default function Rating({stars=5, rate, setRate, height, width, className
<div className='flex justify-center items-center gap-1' title={`Rated By ${rate} Stars`}>
{stars > 0 && ( Array(stars).fill(0).map((_, i) =>
<div onClick={() => setRate(i+1)} onMouseEnter={() => setRate(i+1)} key={i}>
<Rate className={className} height={height} width={width} fill={rate > 0 && i < rate} color={"#d37036"}/>
<Rate className={className} height={height} width={width} fill={rate > 0 && i < rate} color={"#e7702b"}/>
</div>
))}
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/components/Reviews/Stars.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ Stars.propTypes = {
className: PropType.string,
}

export default function Stars({rate, stars=5, className="w-6 h-6"}) {
export default function Stars({rate, stars=5, className}) {
return (
<div className='flex justify-center items-center gap-1' title={`Rated By ${rate} Stars`}>
<div className='bg-[#e7702b]- flex justify-center items-center gap-1' title={`Rated By ${rate} Stars`}>
{stars > 0 && ( Array(stars).fill(0).map((_, i) =>
<div key={i}>
<Rate fill={rate > 0 && i < rate} className={className} color={"#d37036"}/>
<Rate fill={rate > 0 && i < rate} className={className + " w-6 h-6"} color={"#e7702b"}/>
</div>
))}
</div>
Expand Down
Loading

0 comments on commit 3a1c5d0

Please sign in to comment.