|
3 | 3 | import { useEffect, useState } from "react"; |
4 | 4 | import Link from "next/link"; |
5 | 5 | import { useSearchParams } from "next/navigation"; |
6 | | -import { getMe, resetDemoData, type MeResponse } from "@/lib/api"; |
| 6 | +import { getMe, type MeResponse } from "@/lib/api"; |
7 | 7 | import { useRestaurantStore, useCategories } from "@/stores/restaurantStore"; |
8 | 8 |
|
9 | 9 | interface AuthState { |
@@ -32,8 +32,6 @@ export default function AdminContent({ |
32 | 32 | user: null, |
33 | 33 | isAdmin: false, |
34 | 34 | }); |
35 | | - const [resettingDemo, setResettingDemo] = useState(false); |
36 | | - |
37 | 35 | const { data, loadRestaurant } = useRestaurantStore(); |
38 | 36 | const categories = useCategories(); |
39 | 37 |
|
@@ -75,16 +73,6 @@ export default function AdminContent({ |
75 | 73 | window.location.href = "/cdn-cgi/access/logout"; |
76 | 74 | }; |
77 | 75 |
|
78 | | - const handleDemoReset = async () => { |
79 | | - setResettingDemo(true); |
80 | | - try { |
81 | | - await resetDemoData(); |
82 | | - await loadRestaurant(); |
83 | | - } finally { |
84 | | - setResettingDemo(false); |
85 | | - } |
86 | | - }; |
87 | | - |
88 | 76 | if (authState.loading) { |
89 | 77 | return ( |
90 | 78 | <div style={{ height: "100vh", display: "flex", alignItems: "center", justifyContent: "center", background: "#FBFAF9", fontFamily: "system-ui, sans-serif" }}> |
@@ -206,15 +194,6 @@ export default function AdminContent({ |
206 | 194 |
|
207 | 195 | return ( |
208 | 196 | <div style={{ display: "flex", flexDirection: "column", height: "100vh", fontFamily: "system-ui, -apple-system, sans-serif", fontSize: 13, color: "#424242", background: "#FBFAF9" }}> |
209 | | - {authState.user.demoMode && ( |
210 | | - <div style={{ background: "#FFF7ED", color: "#9A3412", borderBottom: "1px solid #FED7AA", padding: "8px 18px", display: "flex", alignItems: "center", gap: 12, flexShrink: 0 }}> |
211 | | - <strong style={{ fontSize: 12 }}>Demo mode</strong> |
212 | | - <span style={{ fontSize: 12, flex: 1 }}>This admin is public. Data resets automatically, so do not enter real customer data.</span> |
213 | | - <button onClick={handleDemoReset} disabled={resettingDemo} style={{ border: "1px solid #FDBA74", background: "#fff", color: "#9A3412", borderRadius: 5, padding: "4px 9px", fontSize: 12, fontWeight: 600, cursor: resettingDemo ? "default" : "pointer", opacity: resettingDemo ? 0.6 : 1 }}> |
214 | | - {resettingDemo ? "Resetting..." : "Reset now"} |
215 | | - </button> |
216 | | - </div> |
217 | | - )} |
218 | 197 | <header style={{ height: 52, background: "#1F1A14", display: "flex", alignItems: "center", padding: "0 18px", gap: 20, flexShrink: 0 }}> |
219 | 198 | <div style={{ flexShrink: 0, display: "flex", alignItems: "center", gap: 10 }}> |
220 | 199 | <div style={{ width: 30, height: 30, borderRadius: 6, background: "#C47A4F", color: "#fff", display: "flex", alignItems: "center", justifyContent: "center", fontSize: 10.5, fontWeight: 800, letterSpacing: 0.3, flexShrink: 0 }}> |
|
0 commit comments