()
| 1831 | } |
| 1832 | |
| 1833 | const MutationStatusCount: Component = () => { |
| 1834 | const counts = createSubscribeToMutationCacheBatcher((mutationCache) => { |
| 1835 | const tally = { green: 0, yellow: 0, purple: 0, red: 0, gray: 0 } |
| 1836 | for (const mutation of mutationCache().getAll()) { |
| 1837 | tally[getMutationStatusColor(mutation.state)]++ |
| 1838 | } |
| 1839 | return tally |
| 1840 | }) |
| 1841 | |
| 1842 | const theme = useTheme() |
| 1843 | const css = useQueryDevtoolsContext().shadowDOMTarget |
| 1844 | ? goober.css.bind({ target: useQueryDevtoolsContext().shadowDOMTarget }) |
| 1845 | : goober.css |
| 1846 | const styles = createMemo(() => { |
| 1847 | return theme() === 'dark' ? darkStyles(css) : lightStyles(css) |
| 1848 | }) |
| 1849 | |
| 1850 | return ( |
| 1851 | <div |
| 1852 | class={cx(styles().queryStatusContainer, 'tsqd-query-status-container')} |
| 1853 | > |
| 1854 | <QueryStatus label="Paused" color="purple" count={counts().purple} /> |
| 1855 | <QueryStatus label="Pending" color="yellow" count={counts().yellow} /> |
| 1856 | <QueryStatus label="Success" color="green" count={counts().green} /> |
| 1857 | <QueryStatus label="Error" color="red" count={counts().red} /> |
| 1858 | </div> |
| 1859 | ) |
| 1860 | } |
| 1861 | |
| 1862 | const QueryStatus: Component<QueryStatusProps> = (props) => { |
| 1863 | const { selectedQueryHash, panelWidth } = useDevtoolsState() |
nothing calls this directly
no test coverage detected