diff --git a/components/icons.tsx b/components/icons.tsx index ad71d8099..d5797ce64 100644 --- a/components/icons.tsx +++ b/components/icons.tsx @@ -62,6 +62,7 @@ export { QuoteIcon, QuoteIcon as Quote } from "@solar-icons/react/bold-duotone/q export { Dialog2Icon as LanguagesIcon, Dialog2Icon as Languages } from "@solar-icons/react/bold-duotone/dialog-2"; export { Chart2Icon as AnalyticsIcon, Chart2Icon as BarChart3 } from "@solar-icons/react/bold-duotone/chart-2"; export { LinkIcon, LinkIcon as Link2 } from "@solar-icons/react/bold-duotone/link"; +export { VideocameraIcon as Video } from "@solar-icons/react/bold-duotone/videocamera"; export { Plane2Icon as PublishIcon, Plane2Icon as Send } from "@solar-icons/react/bold-duotone/plane-2"; export { TrashBinTrashIcon as TrashIcon, TrashBinTrashIcon as Trash2 } from "@solar-icons/react/bold-duotone/trash-bin-trash"; export { Book2Icon as BookIcon, Book2Icon as BookOpen } from "@solar-icons/react/bold-duotone/book-2"; diff --git a/components/icons/meeting-icons.tsx b/components/icons/meeting-icons.tsx new file mode 100644 index 000000000..a5fea2a80 --- /dev/null +++ b/components/icons/meeting-icons.tsx @@ -0,0 +1,49 @@ +// The services a meeting link can be on, by its address: their own marks, and a camera for any other. + +import { Video } from "@/components/icons"; + +export type MeetingService = "zoom" | "meet" | "teams" | "other"; + +/** Which service a meeting link is on. */ +export function serviceOf(url: string): MeetingService { + let host = ""; + try { + host = new URL(url).hostname.toLowerCase(); + } catch { + return "other"; + } + if (host === "zoom.us" || host.endsWith(".zoom.us") || host.endsWith(".zoomgov.com")) return "zoom"; + if (host === "meet.google.com") return "meet"; + if (host === "teams.microsoft.com" || host === "teams.live.com" || host.endsWith(".teams.microsoft.com")) return "teams"; + return "other"; +} + +/** Whether a link is a sign-up page rather than the call: Zoom's registration for a meeting or a webinar. */ +export const isSignUp = (url: string) => serviceOf(url) === "zoom" && /\/(meeting|webinar)\/register\//.test(url); + +/** Zoom's app mark: its camera, white on its blue. */ +function ZoomMark({ className }: { className?: string }) { + return ( + + + + + ); +} + +/** Google Meet's mark (Simple Icons). */ +function MeetMark({ className }: { className?: string }) { + return ( + + + + ); +} + +/** The mark for a meeting link's service. Teams has no mark it lets others draw, so it takes the camera. */ +export function MeetingMark({ url, className }: { url: string; className?: string }) { + const service = serviceOf(url); + if (service === "zoom") return ; + if (service === "meet") return ; + return