mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-21 12:49:06 +00:00
fix: minor code quality improvements - add emoji constants, fix type safety, cleanup comments
This commit is contained in:
@@ -84,7 +84,9 @@ function MeetingStatus({ roomName }: { roomName: string }) {
|
|||||||
|
|
||||||
if (activeMeetings.length > 0) {
|
if (activeMeetings.length > 0) {
|
||||||
const meeting = activeMeetings[0];
|
const meeting = activeMeetings[0];
|
||||||
const title = (meeting.calendar_metadata as any)?.title || "Active Meeting";
|
const title = String(
|
||||||
|
meeting.calendar_metadata?.["title"] || "Active Meeting",
|
||||||
|
);
|
||||||
return (
|
return (
|
||||||
<VStack gap={1} alignItems="start">
|
<VStack gap={1} alignItems="start">
|
||||||
<Badge colorScheme="green" size="sm">
|
<Badge colorScheme="green" size="sm">
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ interface SelectOption {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const RESERVED_PATHS = ["browse", "rooms", "transcripts"];
|
const RESERVED_PATHS = ["browse", "rooms", "transcripts"];
|
||||||
|
const SUCCESS_EMOJI = "✅";
|
||||||
|
const ERROR_EMOJI = "❌";
|
||||||
|
|
||||||
const roomModeOptions: SelectOption[] = [
|
const roomModeOptions: SelectOption[] = [
|
||||||
{ label: "2-4 people", value: "normal" },
|
{ label: "2-4 people", value: "normal" },
|
||||||
@@ -225,10 +227,10 @@ export default function RoomsList() {
|
|||||||
|
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
setWebhookTestResult(
|
setWebhookTestResult(
|
||||||
`✅ Webhook test successful! Status: ${response.status_code}`,
|
`${SUCCESS_EMOJI} Webhook test successful! Status: ${response.status_code}`,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
let errorMsg = `❌ Webhook test failed`;
|
let errorMsg = `${ERROR_EMOJI} Webhook test failed`;
|
||||||
errorMsg += ` (Status: ${response.status_code})`;
|
errorMsg += ` (Status: ${response.status_code})`;
|
||||||
if (response.error) {
|
if (response.error) {
|
||||||
errorMsg += `: ${response.error}`;
|
errorMsg += `: ${response.error}`;
|
||||||
@@ -828,11 +830,11 @@ export default function RoomsList() {
|
|||||||
padding: "8px",
|
padding: "8px",
|
||||||
borderRadius: "4px",
|
borderRadius: "4px",
|
||||||
backgroundColor: webhookTestResult.startsWith(
|
backgroundColor: webhookTestResult.startsWith(
|
||||||
"✅",
|
SUCCESS_EMOJI,
|
||||||
)
|
)
|
||||||
? "#f0fdf4"
|
? "#f0fdf4"
|
||||||
: "#fef2f2",
|
: "#fef2f2",
|
||||||
border: `1px solid ${webhookTestResult.startsWith("✅") ? "#86efac" : "#fca5a5"}`,
|
border: `1px solid ${webhookTestResult.startsWith(SUCCESS_EMOJI) ? "#86efac" : "#fca5a5"}`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{webhookTestResult}
|
{webhookTestResult}
|
||||||
|
|||||||
@@ -371,7 +371,6 @@ export default function Room(details: RoomDetails) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// For ICS-enabled rooms, show meeting selection
|
|
||||||
if (room.ics_enabled) {
|
if (room.ics_enabled) {
|
||||||
return (
|
return (
|
||||||
<MeetingSelection
|
<MeetingSelection
|
||||||
|
|||||||
@@ -580,13 +580,12 @@ export function useMeetingDeactivate() {
|
|||||||
const key = query.queryKey;
|
const key = query.queryKey;
|
||||||
return (
|
return (
|
||||||
Array.isArray(key) &&
|
Array.isArray(key) &&
|
||||||
(key.some(
|
key.some(
|
||||||
(k) => typeof k === "string" && k.includes("/meetings/active"),
|
(k) =>
|
||||||
) ||
|
typeof k === "string" &&
|
||||||
key.some(
|
(k.includes("/meetings/active") ||
|
||||||
(k) =>
|
k.includes("/meetings/upcoming")),
|
||||||
typeof k === "string" && k.includes("/meetings/upcoming"),
|
)
|
||||||
))
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -747,3 +746,4 @@ export function useRoomCalendarEvents(roomName: string | null) {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
// End of Calendar integration hooks
|
||||||
|
|||||||
Reference in New Issue
Block a user