MCPcopy Create free account
hub / github.com/campsite/campsite / ProjectCallButton

Function ProjectCallButton

apps/web/components/Projects/ProjectCallButton.tsx:14–45  ·  view source on GitHub ↗
({ project, hotkey = false, ...buttonProps }: Props)

Source from the content-addressed store, hash-verified

12}
13
14export function ProjectCallButton({ project, hotkey = false, ...buttonProps }: Props) {
15 // TODO: Support calls in post projects.
16 // https://linear.app/campsite/project/calls-in-channels-9f829815473a/overview
17 const { data: thread } = useGetThread({ threadId: project?.message_thread_id })
18 const { joinCall, canJoin, onCall } = useJoinMessageThreadCall({ thread })
19 const label = onCall ? 'Already joined call' : 'Start call'
20
21 if (!canJoin && !onCall) return null
22
23 return (
24 <>
25 {hotkey && (
26 <LayeredHotkeys
27 keys='mod+shift+h'
28 callback={joinCall}
29 options={{ preventDefault: true, enableOnContentEditable: true }}
30 />
31 )}
32
33 <Button
34 accessibilityLabel='Start call'
35 tooltip={buttonProps?.iconOnly ? label : undefined}
36 tooltipShortcut={hotkey ? '⌘+shift+H' : undefined}
37 onClick={joinCall}
38 disabled={onCall}
39 {...buttonProps}
40 >
41 {buttonProps.children || (!buttonProps.iconOnly && label)}
42 </Button>
43 </>
44 )
45}
46
47export function BreadcrumbProjectCallButton({ project }: Props) {
48 return <ProjectCallButton project={project} variant='plain' hotkey iconOnly={<VideoCameraIcon size={24} />} />

Callers

nothing calls this directly

Calls 2

useGetThreadFunction · 0.90
useJoinMessageThreadCallFunction · 0.90

Tested by

no test coverage detected