Fix bootcamp and webinar action buttons
Bootcamp fixes: - Change "Sudah Selesai" to "Selesai" (shorter, cleaner) - Replace "Selanjutnya" button with "Beri Ulasan" when all lessons completed - Makes more sense than "Lanjutkan" when there's nothing to continue Webinar fixes: - Check if webinar has ended based on event_start date - Only show "Gabung Webinar" button if webinar hasn't ended AND has meeting link - Show "Rekaman segera tersedia" badge for passed webinars without recording - Only show recording player/video if recording_url exists 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -254,6 +254,9 @@ export default function ProductDetail() {
|
||||
</Button>
|
||||
);
|
||||
case 'webinar':
|
||||
// Check if webinar has ended
|
||||
const webinarEnded = product.event_start && new Date(product.event_start) <= new Date();
|
||||
|
||||
if (product.recording_url) {
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
@@ -274,14 +277,25 @@ export default function ProductDetail() {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return product.meeting_link ? (
|
||||
<Button asChild size="lg" className="shadow-sm">
|
||||
<a href={product.meeting_link} target="_blank" rel="noopener noreferrer">
|
||||
<Video className="w-4 h-4 mr-2" />
|
||||
Gabung Webinar
|
||||
</a>
|
||||
</Button>
|
||||
) : <Badge className="bg-primary text-primary-foreground">Rekaman segera tersedia</Badge>;
|
||||
|
||||
// Only show "Gabung Webinar" if webinar hasn't ended and has meeting link
|
||||
if (!webinarEnded && product.meeting_link) {
|
||||
return (
|
||||
<Button asChild size="lg" className="shadow-sm">
|
||||
<a href={product.meeting_link} target="_blank" rel="noopener noreferrer">
|
||||
<Video className="w-4 h-4 mr-2" />
|
||||
Gabung Webinar
|
||||
</a>
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
|
||||
// Webinar has ended but no recording yet
|
||||
if (webinarEnded) {
|
||||
return <Badge className="bg-muted text-primary">Rekaman segera tersedia</Badge>;
|
||||
}
|
||||
|
||||
return null;
|
||||
case 'bootcamp':
|
||||
return (
|
||||
<Button onClick={() => navigate(`/bootcamp/${product.slug}`)} size="lg" className="shadow-sm">
|
||||
|
||||
Reference in New Issue
Block a user