MCPcopy
hub / github.com/formatjs/formatjs / CoreApp

Function CoreApp

packages/editor/index.tsx:42–174  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40}
41
42export function CoreApp() {
43 const intl = useIntl()
44 const [messages, setMessages] = useState<TranslatedMessage[]>([])
45 const [isLoading, setIsLoading] = useState<boolean>(true)
46 useEffect(function () {
47 ;(async function () {
48 setMessages(await fetchData())
49 setIsLoading(false)
50 })()
51 }, [])
52 return (
53 <>
54 <CssBaseline />
55 <Box height="100vh">
56 <AppBar position="static">
57 <Toolbar variant="dense">
58 <IconButton edge="start" color="inherit" aria-label="menu">
59 <Menu />
60 </IconButton>
61 <Drawer anchor="left">
62 <List>
63 {['Inbox', 'Starred', 'Send email', 'Drafts'].map(text => (
64 <ListItem button key={text}>
65 <ListItemText primary={text} />
66 </ListItem>
67 ))}
68 </List>
69 </Drawer>
70 <Header />
71 <AddAlert />
72 <NotificationsOff />
73 </Toolbar>
74 </AppBar>
75
76 <Grid container spacing={0}>
77 <Grid xs={3}>
78 <form noValidate autoComplete="off">
79 <TextField
80 type="search"
81 fullWidth
82 margin="none"
83 size="small"
84 variant="filled"
85 label={intl.formatMessage({
86 id: 'search-bar-label',
87 defaultMessage: 'Search message',
88 description: 'label in search bar',
89 })}
90 />
91 </form>
92 <Box borderRight={1} overflow="auto" height="calc(100vh - 108px)">
93 <Messages
94 messages={messages}
95 isLoading={isLoading}
96 count={MESSAGES_COUNT}
97 />
98 </Box>
99 </Grid>

Callers

nothing calls this directly

Calls 3

useIntlFunction · 0.90
fetchDataFunction · 0.85
formatMessageMethod · 0.65

Tested by

no test coverage detected