Compare commits
No commits in common. "61f7f5cf1a9e3bf5685047b1c9ae4e374b128db8" and "74d7a35e60d06ef93b4513ce96bb693c7a90e880" have entirely different histories.
61f7f5cf1a
...
74d7a35e60
@ -695,14 +695,11 @@ export default function AppointmentDetailPage() {
|
|||||||
<div className={`rounded-2xl border shadow-sm overflow-hidden ${isDark ? "bg-gradient-to-br from-blue-900/20 to-purple-900/20 border-blue-800/30" : "bg-gradient-to-br from-blue-50 to-purple-50 border-blue-200"}`}>
|
<div className={`rounded-2xl border shadow-sm overflow-hidden ${isDark ? "bg-gradient-to-br from-blue-900/20 to-purple-900/20 border-blue-800/30" : "bg-gradient-to-br from-blue-50 to-purple-50 border-blue-200"}`}>
|
||||||
<div className="p-6 space-y-3">
|
<div className="p-6 space-y-3">
|
||||||
{(() => {
|
{(() => {
|
||||||
// Check if can join as moderator (handle both boolean and string values)
|
const canJoin = appointment.can_join_as_moderator === true || appointment.can_join_as_moderator === "true";
|
||||||
const canJoinAsModerator = appointment.can_join_as_moderator === true || appointment.can_join_as_moderator === "true";
|
|
||||||
// Check if meeting has started (handle both field names)
|
|
||||||
const startedAt = appointment.started_at || appointment.meeting_started_at;
|
const startedAt = appointment.started_at || appointment.meeting_started_at;
|
||||||
const hasStarted = startedAt != null && startedAt !== "";
|
const hasStarted = startedAt != null && startedAt !== "";
|
||||||
|
|
||||||
// If can_join_as_moderator != true, display "Meeting Not Available"
|
if (!canJoin) {
|
||||||
if (!canJoinAsModerator) {
|
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
disabled
|
disabled
|
||||||
@ -714,7 +711,6 @@ export default function AppointmentDetailPage() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If can_join_as_moderator == true && started_at != null, show "Join Now" button
|
|
||||||
if (hasStarted) {
|
if (hasStarted) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -749,7 +745,6 @@ export default function AppointmentDetailPage() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If can_join_as_moderator == true && started_at == null, show "Start Meeting" button
|
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
onClick={handleStartMeeting}
|
onClick={handleStartMeeting}
|
||||||
|
|||||||
@ -578,52 +578,25 @@ export default function UserAppointmentDetailPage() {
|
|||||||
{appointment.status === "scheduled" && appointment.participant_join_url && (
|
{appointment.status === "scheduled" && appointment.participant_join_url && (
|
||||||
<div className={`rounded-2xl border shadow-sm overflow-hidden ${isDark ? "bg-gradient-to-br from-blue-900/20 to-purple-900/20 border-blue-800/30" : "bg-gradient-to-br from-blue-50 to-purple-50 border-blue-200"}`}>
|
<div className={`rounded-2xl border shadow-sm overflow-hidden ${isDark ? "bg-gradient-to-br from-blue-900/20 to-purple-900/20 border-blue-800/30" : "bg-gradient-to-br from-blue-50 to-purple-50 border-blue-200"}`}>
|
||||||
<div className="p-6">
|
<div className="p-6">
|
||||||
{(() => {
|
{appointment.can_join_as_participant ? (
|
||||||
// Check if can join as participant (handle both boolean and string values)
|
<a
|
||||||
const canJoinAsParticipant = appointment.can_join_as_participant === true || appointment.can_join_as_participant === "true";
|
href={appointment.participant_join_url}
|
||||||
// Check if meeting has started (handle both field names)
|
target="_blank"
|
||||||
const startedAt = appointment.started_at || appointment.meeting_started_at;
|
rel="noopener noreferrer"
|
||||||
const hasStarted = startedAt != null && startedAt !== "";
|
className={`flex items-center justify-center gap-2 w-full bg-blue-600 hover:bg-blue-700 text-white h-12 rounded-lg text-base font-medium transition-colors`}
|
||||||
|
>
|
||||||
// If can_join_as_participant != true, display "Meeting Not Available"
|
<Video className="w-5 h-5" />
|
||||||
if (!canJoinAsParticipant) {
|
Join Meeting
|
||||||
return (
|
</a>
|
||||||
<button
|
) : (
|
||||||
disabled
|
<button
|
||||||
className={`flex items-center justify-center gap-2 w-full cursor-not-allowed h-12 rounded-lg text-base font-medium transition-colors ${isDark ? "bg-gray-700 text-gray-500" : "bg-gray-300 text-gray-500"}`}
|
disabled
|
||||||
>
|
className={`flex items-center justify-center gap-2 w-full cursor-not-allowed h-12 rounded-lg text-base font-medium transition-colors ${isDark ? "bg-gray-700 text-gray-500" : "bg-gray-300 text-gray-500"}`}
|
||||||
<Video className="w-5 h-5" />
|
>
|
||||||
Meeting Not Available
|
<Video className="w-5 h-5" />
|
||||||
</button>
|
Meeting Not Available Yet
|
||||||
);
|
</button>
|
||||||
}
|
)}
|
||||||
|
|
||||||
// If can_join_as_participant == true && started_at != null, show "Join Now" button
|
|
||||||
if (hasStarted) {
|
|
||||||
return (
|
|
||||||
<a
|
|
||||||
href={appointment.participant_join_url}
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
className={`flex items-center justify-center gap-2 w-full bg-blue-600 hover:bg-blue-700 text-white h-12 rounded-lg text-base font-medium transition-colors`}
|
|
||||||
>
|
|
||||||
<Video className="w-5 h-5" />
|
|
||||||
Join Now
|
|
||||||
</a>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// If can_join_as_participant == true && started_at == null, show "Meeting Not Available"
|
|
||||||
return (
|
|
||||||
<button
|
|
||||||
disabled
|
|
||||||
className={`flex items-center justify-center gap-2 w-full cursor-not-allowed h-12 rounded-lg text-base font-medium transition-colors ${isDark ? "bg-gray-700 text-gray-500" : "bg-gray-300 text-gray-500"}`}
|
|
||||||
>
|
|
||||||
<Video className="w-5 h-5" />
|
|
||||||
Meeting Not Available
|
|
||||||
</button>
|
|
||||||
);
|
|
||||||
})()}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user