Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@tailwindcss/vite": "^4.3.1",
"axios": "^1.18.0",
"axios": "^1.18.1",
"lucide-react": "^1.21.0",
"react": "^19.2.7",
"react-dom": "^19.2.7",
Expand Down
195 changes: 1 addition & 194 deletions client/src/assets/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,200 +100,7 @@ export const dummyUser = {
updatedAt: "2026-06-17T13:40:21.669Z",
};

export const dummyRestaurant = [
{
_id: "6a32a3c50e88c825d8873f7d",
name: "L'Essence",
slug: "l-essence",
description:
"An intimate, Parisian-inspired fine dining chamber wrapped in dark velvet and soft golden candle glow. L'Essence specializes in meticulous plating of haute gastronomy, creating a rich sensory dialogue between modern culinary innovation and classic romance.",
cuisine: "French",
priceRange: "$$$$",
rating: 4.9,
reviewCount: 88,
location: "Manhattan, NY",
address: "115 Greenwich St, New York, NY 10006",
image: "/restaurant_5.png",
chef: "Jean-Luc Picard",
tags: ["Romantic", "Velvet Booths", "Candlelit", "Haute Cuisine"],
availableSlots: ["18:00", "19:00", "20:00", "21:00", "22:00"],
featured: true,
exclusive: false,
owner: "6a32a3c50e88c825d8873f77",
status: "approved",
totalSeats: 45,
createdAt: "2026-06-17T13:40:21.828Z",
updatedAt: "2026-06-17T13:40:21.828Z",
},
{
_id: "6a32a3c50e88c825d8873f7a",
name: "Terraza Cielo",
slug: "terraza-cielo",
description:
"A sun-drenched rooftop oasis celebrating Italian and Mediterranean lifestyles. Featuring floor-to-ceiling foliage, white marble bistro tables, and panoramic skyline views, Terraza Cielo serves hand-crafted pastas and coastal seafood paired with bright botanical cocktails.",
cuisine: "Italian",
priceRange: "$$$",
rating: 4.7,
reviewCount: 205,
location: "Manhattan, NY",
address: "244 Fifth Ave Rooftop, New York, NY 10001",
image: "/restaurant_3.jpg",
chef: "Elena Rossi",
tags: ["Rooftop", "Skyline Views", "Handmade Pasta", "Craft Cocktails"],
availableSlots: ["12:00", "13:00", "17:00", "18:00", "19:00", "20:00", "21:00"],
featured: true,
exclusive: false,
owner: "6a32a3c50e88c825d8873f77",
status: "approved",
totalSeats: 30,
createdAt: "2026-06-17T13:40:21.828Z",
updatedAt: "2026-06-17T13:40:21.828Z",
},
{
_id: "6a32a3c50e88c825d8873f79",
name: "Kuro Omakase",
slug: "kuro-omakase",
description:
"An atmospheric, moody sanctuary of premium Japanese gastronomy. Seated at a dark, polished basalt-stone counter, guests experience a deeply focused sushi omakase. Chef Kenji Sato translates the freshest seasonal ingredients directly from Tokyo's fish markets into elegant, edible poetry.",
cuisine: "Japanese",
priceRange: "$$$$",
rating: 4.8,
reviewCount: 92,
location: "Manhattan, NY",
address: "18 Orchard St, New York, NY 10002",
image: "/restaurant_2.jpg",
chef: "Kenji Sato",
tags: ["Omakase", "Basalt Counter", "Japanese", "Zen Atmosphere"],
availableSlots: ["18:00", "20:30"],
featured: true,
exclusive: true,
owner: "6a32a3c50e88c825d8873f77",
status: "approved",
totalSeats: 25,
createdAt: "2026-06-17T13:40:21.828Z",
updatedAt: "2026-06-17T13:40:21.828Z",
},
{
_id: "6a32a3c50e88c825d8873f7c",
name: "Flora Garden",
slug: "flora-garden",
description:
"A bright, airy conservatory celebrating organic, plant-forward gastronomy. Nestled under glass ceilings with floor-to-ceiling botanicals, Flora Garden transforms fresh seasonal crops into delicate, high-end editorial culinary works of art.",
cuisine: "Vegetarian",
priceRange: "$$$",
rating: 4.8,
reviewCount: 110,
location: "Manhattan, NY",
address: "90 Grand St, New York, NY 10013",
image: "/restaurant_6.png",
chef: "Chloe Mercer",
tags: ["Plant-Based", "Glasshouse", "Organic", "Bright & Airy"],
availableSlots: ["11:30", "13:00", "14:30", "17:30", "19:00", "20:30"],
featured: false,
exclusive: false,
owner: "6a32a3c50e88c825d8873f77",
status: "approved",
totalSeats: 40,
createdAt: "2026-06-17T13:40:21.828Z",
updatedAt: "2026-06-17T13:40:21.828Z",
},
{
_id: "6a32a3c50e88c825d8873f7b",
name: "Ember Grille",
slug: "ember-grille",
description:
"An upscale modern steakhouse with exposed brick walls, leather booths, and warm, industrial-chic pendant lighting. Offering Prime dry-aged cuts grilled over live hickory and cherrywood embers. Gourmet dining elevated into a sophisticated nocturnal experience.",
cuisine: "Steakhouse",
priceRange: "$$$$",
rating: 4.6,
reviewCount: 142,
location: "Manhattan, NY",
address: "320 Bowery, New York, NY 10012",
image: "/restaurant_1.png",
chef: "Marcus Vance",
tags: ["Dry-Aged Beef", "Wood Fire", "Moody Lighting", "Wine Room"],
availableSlots: ["17:00", "18:00", "19:00", "20:00", "21:00", "22:00"],
featured: false,
exclusive: false,
owner: "6a32a3c50e88c825d8873f77",
status: "approved",
totalSeats: 35,
createdAt: "2026-06-17T13:40:21.828Z",
updatedAt: "2026-06-17T13:40:21.828Z",
},
{
_id: "6a32a3c50e88c825d8873f78",
name: "L'Artiste",
slug: "l-artiste",
description:
"An avant-garde journey through modern French gastronomy. L'Artiste blends classic French culinary foundations with contemporary visual artistry, resulting in a sensory dining experience that is both theatrical and deeply satisfying. Set in a gorgeous high-ceilinged room with minimal charcoal and gold design language.",
cuisine: "French",
priceRange: "$$$$",
rating: 4.9,
reviewCount: 124,
location: "Manhattan, NY",
address: "420 Mercer St, New York, NY 10003",
image: "/restaurant_4.png",
chef: "Jean-Pierre Dubois",
tags: ["Michelin Star", "Fine Dining", "Tasting Menu", "Romantic"],
availableSlots: ["17:00", "17:30", "18:00", "18:30", "19:00", "19:30", "20:00", "20:30", "21:00", "21:30"],
featured: true,
exclusive: true,
owner: "6a32a3c50e88c825d8873f77",
status: "approved",
totalSeats: 20,
createdAt: "2026-06-17T13:40:21.827Z",
updatedAt: "2026-06-17T13:40:21.827Z",
},
{
_id: "6a32a3c50e88c825d8873f7d",
name: "L'Essence",
slug: "l-essence",
description:
"An intimate, Parisian-inspired fine dining chamber wrapped in dark velvet and soft golden candle glow. L'Essence specializes in meticulous plating of haute gastronomy, creating a rich sensory dialogue between modern culinary innovation and classic romance.",
cuisine: "French",
priceRange: "$$$$",
rating: 4.9,
reviewCount: 88,
location: "Manhattan, NY",
address: "115 Greenwich St, New York, NY 10006",
image: "/restaurant_5.png",
chef: "Jean-Luc Picard",
tags: ["Romantic", "Velvet Booths", "Candlelit", "Haute Cuisine"],
availableSlots: ["18:00", "19:00", "20:00", "21:00", "22:00"],
featured: true,
exclusive: false,
owner: "6a32a3c50e88c825d8873f77",
status: "pending",
totalSeats: 45,
createdAt: "2026-06-17T13:40:21.828Z",
updatedAt: "2026-06-17T13:40:21.828Z",
},
{
_id: "6a32a3c50e88c825d8873f7a",
name: "Terraza Cielo",
slug: "terraza-cielo",
description:
"A sun-drenched rooftop oasis celebrating Italian and Mediterranean lifestyles. Featuring floor-to-ceiling foliage, white marble bistro tables, and panoramic skyline views, Terraza Cielo serves hand-crafted pastas and coastal seafood paired with bright botanical cocktails.",
cuisine: "Italian",
priceRange: "$$$",
rating: 4.7,
reviewCount: 205,
location: "Manhattan, NY",
address: "244 Fifth Ave Rooftop, New York, NY 10001",
image: "/restaurant_3.jpg",
chef: "Elena Rossi",
tags: ["Rooftop", "Skyline Views", "Handmade Pasta", "Craft Cocktails"],
availableSlots: ["12:00", "13:00", "17:00", "18:00", "19:00", "20:00", "21:00"],
featured: true,
exclusive: false,
owner: "6a32a3c50e88c825d8873f77",
status: "pending",
totalSeats: 30,
createdAt: "2026-06-17T13:40:21.828Z",
updatedAt: "2026-06-17T13:40:21.828Z",
},
];
export const dummyRestaurant = [ ];

export const dummyAvailability = [
{ time: "18:00", availableSeats: 45, isAvailable: true },
Expand Down
34 changes: 25 additions & 9 deletions client/src/components/owner/RestaurantWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
import React, { useState } from "react";
import { Utensils, Upload, Image } from "lucide-react";
import toast from "react-hot-toast";
import { dummyRestaurant } from "../../assets/assets.ts";

import api from "../../lib/api.ts";

interface RestaurantWizardProps {
setRestaurant: (restaurant: any) => void;
Expand Down Expand Up @@ -59,17 +60,23 @@ export default function RestaurantWizard({ setRestaurant }: RestaurantWizardProp
};

const handleImageChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const file = e.target.files?.[0];
if (file) {
setImageFile(file);
setImagePreview(URL.createObjectURL(file));
}
};
const file = e.target.files?.[0];

console.log(file);

if (file) {
setImageFile(file);
setImagePreview(URL.createObjectURL(file));
}
}



const handleCreateRestaurant = async (e: React.FormEvent) => {
e.preventDefault();
setFormLoading(true);
try {
console.log("imageFile:", imageFile);
const formData = new FormData();
formData.append("name", name);
formData.append("description", description);
Expand All @@ -84,10 +91,19 @@ export default function RestaurantWizard({ setRestaurant }: RestaurantWizardProp
if (imageFile) {
formData.append("image", imageFile);
}

setRestaurant(dummyRestaurant[0]);

const res = await api.post("/owner/restaurant", formData, {
headers: {
"Content-Type": "multipart/form-data",
},
});
setRestaurant(res.data)
Comment thread
prepwave marked this conversation as resolved.



toast.success("Restaurant profile submitted successfully! Awaiting Admin approval.");
} catch (error: any) {

toast.error(error?.response?.data?.message || "Failed to register restaurant");
} finally {
setFormLoading(false);
Expand Down
7 changes: 4 additions & 3 deletions client/src/components/restaurant/BookingWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@ export default function BookingWidget({
? slotsAvailability
: (restaurant.availableSlots || []).map((s: string) => ({
time: s,
availableSeats: 20,
isAvailable: true,
available: true,

}));

Comment thread
prepwave marked this conversation as resolved.
return allSlots.filter((slotInfo: any) => {
if (!isToday) return true;
const [slotHour, slotMinute] = slotInfo.time.split(":").map(Number);
Expand All @@ -100,7 +101,7 @@ export default function BookingWidget({
})().map((slotInfo: any) => {
const slot = slotInfo.time;
const isSelected = selectedSlot === slot;
const isFull = !slotInfo.isAvailable || slotInfo.availableSeats < Number(selectedGuests);
const isFull = !slotInfo.available;
return (
<button
key={slot}
Expand Down
Loading