This commit is contained in:
@@ -15,7 +15,7 @@ export { ReviewModal } from "./modals";
|
|||||||
export type { ReviewModalProps, ConfirmModalProps } from "./modals";
|
export type { ReviewModalProps, ConfirmModalProps } from "./modals";
|
||||||
|
|
||||||
// Shop Grid
|
// Shop Grid
|
||||||
export { ShopGrid } from "./shop-grid";
|
// export { ShopGrid } from "./shop-grid";
|
||||||
export type { ShopGridProps } from "./shop-grid";
|
export type { ShopGridProps } from "./shop-grid";
|
||||||
|
|
||||||
// Manager
|
// Manager
|
||||||
|
|||||||
@@ -1,46 +1,46 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { ShopCard } from "@/components/molecules/cards";
|
// import { ShopCard } from "@/components/molecules/cards";
|
||||||
import { MOCK_SHOPS } from "@/lib/constants";
|
// import { MOCK_SHOPS } from "@/lib/constants";
|
||||||
|
|
||||||
import type { ShopGridProps } from "./ShopGrid.types";
|
// import type { ShopGridProps } from "./ShopGrid.types";
|
||||||
|
|
||||||
export default function ShopGrid({
|
// export default function ShopGrid({
|
||||||
searchName = "",
|
// searchName = "",
|
||||||
searchAddress = "",
|
// searchAddress = "",
|
||||||
}: ShopGridProps) {
|
// }: ShopGridProps) {
|
||||||
const filtered = MOCK_SHOPS.filter((shop) => {
|
// const filtered = MOCK_SHOPS.filter((shop) => {
|
||||||
const matchesName =
|
// const matchesName =
|
||||||
searchName.trim() === "" ||
|
// searchName.trim() === "" ||
|
||||||
shop.name.toLowerCase().includes(searchName.toLowerCase());
|
// shop.name.toLowerCase().includes(searchName.toLowerCase());
|
||||||
const matchesAddress =
|
// const matchesAddress =
|
||||||
searchAddress.trim() === "" ||
|
// searchAddress.trim() === "" ||
|
||||||
shop.address.toLowerCase().includes(searchAddress.toLowerCase());
|
// shop.address.toLowerCase().includes(searchAddress.toLowerCase());
|
||||||
return matchesName && matchesAddress;
|
// return matchesName && matchesAddress;
|
||||||
});
|
// });
|
||||||
|
|
||||||
if (filtered.length === 0) {
|
// if (filtered.length === 0) {
|
||||||
return (
|
// return (
|
||||||
<div className="flex flex-col items-center justify-center gap-4 py-24 text-(--color-text-muted)">
|
// <div className="flex flex-col items-center justify-center gap-4 py-24 text-(--color-text-muted)">
|
||||||
<i className="fa-solid fa-store text-5xl opacity-30"></i>
|
// <i className="fa-solid fa-store text-5xl opacity-30"></i>
|
||||||
<p className="text-base font-medium">
|
// <p className="text-base font-medium">
|
||||||
No shops found matching your search
|
// No shops found matching your search
|
||||||
</p>
|
// </p>
|
||||||
</div>
|
// </div>
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
|
|
||||||
return (
|
// return (
|
||||||
<div className="grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3">
|
// <div className="grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3">
|
||||||
{filtered.map((shop) => (
|
// {filtered.map((shop) => (
|
||||||
<ShopCard
|
// <ShopCard
|
||||||
key={shop.id}
|
// key={shop.id}
|
||||||
id={shop.id}
|
// id={shop.id}
|
||||||
name={shop.name}
|
// name={shop.name}
|
||||||
address={shop.address}
|
// address={shop.address}
|
||||||
image={shop.image}
|
// image={shop.image}
|
||||||
/>
|
// />
|
||||||
))}
|
// ))}
|
||||||
</div>
|
// </div>
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
export { default as ShopGrid } from "./ShopGrid";
|
// export { default as ShopGrid } from "./ShopGrid";
|
||||||
export type { ShopGridProps } from "./ShopGrid.types";
|
export type { ShopGridProps } from "./ShopGrid.types";
|
||||||
|
|||||||
Reference in New Issue
Block a user