()
| 1801 | } |
| 1802 | |
| 1803 | const QueryStatusCount: Component = () => { |
| 1804 | const counts = createSubscribeToQueryCacheBatcher((queryCache) => { |
| 1805 | const tally = { fresh: 0, fetching: 0, paused: 0, stale: 0, inactive: 0 } |
| 1806 | for (const query of queryCache().getAll()) { |
| 1807 | tally[getQueryStatusLabel(query)]++ |
| 1808 | } |
| 1809 | return tally |
| 1810 | }) |
| 1811 | |
| 1812 | const theme = useTheme() |
| 1813 | const css = useQueryDevtoolsContext().shadowDOMTarget |
| 1814 | ? goober.css.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) |
| 1815 | : goober.css |
| 1816 | const styles = createMemo(() => { |
| 1817 | return theme() === 'dark' ? darkStyles(css) : lightStyles(css) |
| 1818 | }) |
| 1819 | |
| 1820 | return ( |
| 1821 | <div |
| 1822 | class={cx(styles().queryStatusContainer, 'tsqd-query-status-container')} |
| 1823 | > |
| 1824 | <QueryStatus label="Fresh" color="green" count={counts().fresh} /> |
| 1825 | <QueryStatus label="Fetching" color="blue" count={counts().fetching} /> |
| 1826 | <QueryStatus label="Paused" color="purple" count={counts().paused} /> |
| 1827 | <QueryStatus label="Stale" color="yellow" count={counts().stale} /> |
| 1828 | <QueryStatus label="Inactive" color="gray" count={counts().inactive} /> |
| 1829 | </div> |
| 1830 | ) |
| 1831 | } |
| 1832 | |
| 1833 | const MutationStatusCount: Component = () => { |
| 1834 | const counts = createSubscribeToMutationCacheBatcher((mutationCache) => { |
nothing calls this directly
no test coverage detected