onSelect(cacheKey)}
9 | style={{
10 | width: "100%",
11 | boxSizing: "border-box",
12 | backgroundColor: cacheKey === selectedKey ? "#90DAE880" : undefined,
13 | // padding: "0.4rem",
14 | }}
15 | >
16 |
25 |
26 |
43 |
44 |
61 |
75 | {cacheKey}
76 |
77 |
78 |
79 | );
80 | }
81 |
--------------------------------------------------------------------------------
/src/SWRDevtools/Keys/index.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import { Rnd } from "react-rnd";
3 | import themes from "../themes";
4 | import { KeysProps } from "../types";
5 | import useKeysState from "./useKeysState";
6 | import KeyItem from "./KeyItem";
7 | import CloseIcon from "../Icons/CloseIcon";
8 |
9 | export default function Keys({
10 | keys,
11 | selectedKey,
12 | onSelect,
13 | onClear,
14 | onRevalidate,
15 | theme,
16 | panelWidth,
17 | children = <>>,
18 | }: KeysProps) {
19 | const {
20 | handleResize,
21 | query,
22 | handleSetQuery,
23 | handleClearQuery,
24 | state: { width, height },
25 | } = useKeysState();
26 | return (
27 | <>
28 |