(props)
| 1530 | } |
| 1531 | |
| 1532 | const QueryStatus: Component<QueryStatusProps> = (props) => { |
| 1533 | const { selectedQueryHash, panelWidth } = useDevtoolsState() |
| 1534 | |
| 1535 | const theme = useTheme() |
| 1536 | const themed = createThemed(theme) |
| 1537 | |
| 1538 | let tagRef!: HTMLButtonElement |
| 1539 | |
| 1540 | const [mouseOver, setMouseOver] = createSignal(false) |
| 1541 | const [focused, setFocused] = createSignal(false) |
| 1542 | |
| 1543 | const showLabel = createMemo(() => { |
| 1544 | if (selectedQueryHash()) { |
| 1545 | if (panelWidth() < firstBreakpoint && panelWidth() > secondBreakpoint) { |
| 1546 | return false |
| 1547 | } |
| 1548 | } |
| 1549 | if (panelWidth() < secondBreakpoint) { |
| 1550 | return false |
| 1551 | } |
| 1552 | |
| 1553 | return true |
| 1554 | }) |
| 1555 | |
| 1556 | return ( |
| 1557 | <button |
| 1558 | onFocus={() => setFocused(true)} |
| 1559 | onBlur={() => setFocused(false)} |
| 1560 | onMouseEnter={() => setMouseOver(true)} |
| 1561 | onMouseLeave={() => { |
| 1562 | setMouseOver(false) |
| 1563 | setFocused(false) |
| 1564 | }} |
| 1565 | disabled={showLabel()} |
| 1566 | ref={tagRef} |
| 1567 | aria-label={`${props.label}: ${props.count}`} |
| 1568 | class={`${themed('tsqd-style-query-status-tag')} ${!showLabel() ? themed('tsqd-style-query-status-tag-clickable') : ''} tsqd-query-status-tag tsqd-query-status-tag-${props.label.toLowerCase()}`} |
| 1569 | {...(mouseOver() || focused() |
| 1570 | ? { |
| 1571 | 'aria-describedby': 'tsqd-status-tooltip', |
| 1572 | } |
| 1573 | : {})} |
| 1574 | > |
| 1575 | <Show when={!showLabel() && (mouseOver() || focused())}> |
| 1576 | <div |
| 1577 | role="tooltip" |
| 1578 | id="tsqd-status-tooltip" |
| 1579 | class={`${themed('tsqd-style-status-tooltip')} tsqd-query-status-tooltip`} |
| 1580 | > |
| 1581 | {props.label} |
| 1582 | </div> |
| 1583 | </Show> |
| 1584 | <span |
| 1585 | aria-hidden="true" |
| 1586 | class={`tsqd-style-query-status-dot tsqd-style-query-status-dot-${props.color} tsqd-query-status-tag-dot`} |
| 1587 | /> |
| 1588 | <Show when={showLabel()}> |
| 1589 | <span class="tsqd-style-query-status-tag-label tsqd-query-status-tag-label"> |
nothing calls this directly
no test coverage detected