Fix member dashboard issues and webinar datetime loading

- Remove payment_provider filter to show all paid products (webinars now appear)
- Fix webinar event_start field loading in AdminProducts (format to datetime-local)
- Update order status badge colors for better visibility (green for paid, amber for pending)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
dwindown
2025-12-25 17:56:51 +07:00
parent f381c68371
commit fe9a8bde1d
3 changed files with 5 additions and 6 deletions

View File

@@ -354,7 +354,7 @@ export default function ProductDetail() {
<Badge className="bg-brand-accent text-white">Segera Hadir</Badge>
)}
{product.type === 'webinar' && !product.recording_url && product.event_start && new Date(product.event_start) <= new Date() && (
<Badge className="bg-muted text-primary">Telah Selesai</Badge>
<Badge className="bg-muted text-primary">Telah Lewat</Badge>
)}
{hasAccess && <Badge className="bg-primary text-primary-foreground">Anda memiliki akses</Badge>}
</div>

View File

@@ -78,7 +78,7 @@ export default function AdminProducts() {
const generateSlug = (title: string) => title.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/(^-|-$)/g, '');
const handleEdit = (product: Product) => {
const handleEdit = (product: Product) => {
setEditingProduct(product);
setForm({
title: product.title,
@@ -88,7 +88,7 @@ export default function AdminProducts() {
content: product.content || '',
meeting_link: product.meeting_link || '',
recording_url: product.recording_url || '',
event_start: product.event_start,
event_start: product.event_start ? product.event_start.slice(0, 16) : null,
duration_minutes: product.duration_minutes,
price: product.price,
sale_price: product.sale_price,

View File

@@ -126,8 +126,7 @@ export default function MemberDashboard() {
`,
)
.eq("user_id", user!.id)
.eq("payment_status", "paid")
.eq("payment_provider", "pakasir"),
.eq("payment_status", "paid"),
supabase.from("profiles").select("whatsapp_number").eq("id", user!.id).single(),
]);
@@ -299,7 +298,7 @@ export default function MemberDashboard() {
</p>
</div>
<div className="flex items-center gap-4">
<Badge className={order.payment_status === "paid" ? "bg-brand-accent text-white" : "bg-muted text-primary"}>
<Badge className={order.payment_status === "paid" ? "bg-green-600 text-white border-2 border-green-700" : "bg-amber-500 text-white border-2 border-amber-600"}>
{order.payment_status === "paid" ? "Lunas" : "Pending"}
</Badge>
<span className="font-bold">{formatIDR(order.total_amount)}</span>