feat: implement app directory routing, authentication flow, and dynamic reporting module

This commit is contained in:
Firman Ramdhani
2026-08-28 15:50:01 +07:00
parent 3e68d12ce4
commit 84e6599b23
28 changed files with 1869 additions and 478 deletions
+8 -5
View File
@@ -7,7 +7,7 @@ import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from
import { Checkbox } from '@/components/ui/checkbox'
import { Label } from '@/components/ui/label'
import { Input } from '@/components/ui/input'
import { submitOrder, getUserSubmission } from '@/app/actions'
import { submitOrder, getUserSubmission, getSessionUser } from '@/app/actions'
import { PlusCircle, MinusCircle, User, CheckCircle2, ShoppingBag, Sparkles, Users } from 'lucide-react'
import { format } from 'date-fns'
@@ -113,11 +113,14 @@ function OrderFormModal({ order, onSuccess }: { order: any, onSuccess: () => voi
const [error, setError] = useState('')
useEffect(() => {
const id = localStorage.getItem('user_id')
if (id) {
setUserId(id)
loadExistingSubmission(id)
const init = async () => {
const user = await getSessionUser()
if (user?.id) {
setUserId(user.id)
loadExistingSubmission(user.id)
}
}
init()
}, [order.id])
const loadExistingSubmission = async (uid: string) => {