diff --git a/src/pages/ProductDetail.tsx b/src/pages/ProductDetail.tsx
index ea958f4..0be6721 100644
--- a/src/pages/ProductDetail.tsx
+++ b/src/pages/ProductDetail.tsx
@@ -302,6 +302,12 @@ export default function ProductDetail() {
setExpandedLessonChapters(newSet);
};
+ // Check if product has any recording (YouTube, M3U8, or MP4)
+ const hasRecording = () => {
+ if (!product) return false;
+ return !!(product.recording_url || product.m3u8_url || product.mp4_url);
+ };
+
if (loading) {
return (
);
}
@@ -332,7 +338,7 @@ export default function ProductDetail() {
);
case 'webinar':
- if (product.recording_url) {
+ if (hasRecording()) {
return (
@@ -528,13 +534,13 @@ export default function ProductDetail() {
{product.title}
{product.type}
- {product.type === 'webinar' && product.recording_url && (
+ {product.type === 'webinar' && hasRecording() && (
Rekaman Tersedia
)}
- {product.type === 'webinar' && !product.recording_url && product.event_start && new Date(product.event_start) > new Date() && (
+ {product.type === 'webinar' && !hasRecording() && product.event_start && new Date(product.event_start) > new Date() && (
Segera Hadir
)}
- {product.type === 'webinar' && !product.recording_url && product.event_start && new Date(product.event_start) <= new Date() && (
+ {product.type === 'webinar' && !hasRecording() && product.event_start && new Date(product.event_start) <= new Date() && (
Telah Lewat
)}