- {appointment.can_join_as_participant ? (
-
-
- Join Meeting
-
- ) : (
-
- )}
+ {(() => {
+ // Check if can join as participant (handle both boolean and string values)
+ const canJoinAsParticipant = appointment.can_join_as_participant === true || appointment.can_join_as_participant === "true";
+ // Check if meeting has started (handle both field names)
+ const startedAt = appointment.started_at || appointment.meeting_started_at;
+ const hasStarted = startedAt != null && startedAt !== "";
+
+ // If can_join_as_participant != true, display "Meeting Not Available"
+ if (!canJoinAsParticipant) {
+ return (
+
+ );
+ }
+
+ // If can_join_as_participant == true && started_at != null, show "Join Now" button
+ if (hasStarted) {
+ return (
+
+
+ Join Now
+
+ );
+ }
+
+ // If can_join_as_participant == true && started_at == null, show "Meeting Not Available"
+ return (
+
+ );
+ })()}