()
| 40 | } |
| 41 | |
| 42 | export 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> |
nothing calls this directly
no test coverage detected