(props: {
dataPath: Array<string>
activeQuery: Query
})
| 138 | } |
| 139 | |
| 140 | const ClearArrayButton = (props: { |
| 141 | dataPath: Array<string> |
| 142 | activeQuery: Query |
| 143 | }) => { |
| 144 | const theme = useTheme() |
| 145 | const themed = createThemed(theme) |
| 146 | const queryClient = useQueryDevtoolsContext().client |
| 147 | |
| 148 | return ( |
| 149 | <button |
| 150 | class={themed('tsqd-style-explorer-action-button')} |
| 151 | title={'Remove all items'} |
| 152 | aria-label={'Remove all items'} |
| 153 | onClick={() => { |
| 154 | const oldData = props.activeQuery.state.data |
| 155 | const newData = updateNestedDataByPath(oldData, props.dataPath, []) |
| 156 | queryClient.setQueryData(props.activeQuery.queryKey, newData) |
| 157 | }} |
| 158 | > |
| 159 | <List /> |
| 160 | </button> |
| 161 | ) |
| 162 | } |
| 163 | |
| 164 | const DeleteItemButton = (props: { |
| 165 | dataPath: Array<string> |
nothing calls this directly
no test coverage detected