MCPcopy Create free account
hub / github.com/ChurchApps/B1Admin / ChatWidgetShell

Function ChatWidgetShell

src/components/chatShared/ChatWidgetShell.tsx:9–33  ·  view source on GitHub ↗
({ renderTrigger, renderPanel })

Source from the content-addressed store, hash-verified

7}
8
9export const ChatWidgetShell: React.FC<Props> = ({ renderTrigger, renderPanel }) => {
10 const [open, setOpen] = React.useState(false);
11 const theme = useTheme();
12 const isMobile = useMediaQuery(theme.breakpoints.down("sm"));
13
14 return (
15 <>
16 {!open && renderTrigger(() => setOpen(true))}
17 <Drawer
18 anchor="right"
19 open={open}
20 onClose={() => setOpen(false)}
21 variant="persistent"
22 sx={{
23 "& .MuiDrawer-paper": {
24 width: isMobile ? "100%" : 400,
25 maxWidth: "100vw"
26 }
27 }}
28 >
29 {renderPanel(() => setOpen(false))}
30 </Drawer>
31 </>
32 );
33};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected