(props: {
dataPath: Array<string>
activeQuery: Query
})
| 162 | } |
| 163 | |
| 164 | const DeleteItemButton = (props: { |
| 165 | dataPath: Array<string> |
| 166 | activeQuery: Query |
| 167 | }) => { |
| 168 | const theme = useTheme() |
| 169 | const themed = createThemed(theme) |
| 170 | const queryClient = useQueryDevtoolsContext().client |
| 171 | |
| 172 | return ( |
| 173 | <button |
| 174 | class={themed('tsqd-style-explorer-action-button')} |
| 175 | title={'Delete item'} |
| 176 | aria-label={'Delete item'} |
| 177 | onClick={() => { |
| 178 | const oldData = props.activeQuery.state.data |
| 179 | const newData = deleteNestedDataByPath(oldData, props.dataPath) |
| 180 | queryClient.setQueryData(props.activeQuery.queryKey, newData) |
| 181 | }} |
| 182 | > |
| 183 | <Trash /> |
| 184 | </button> |
| 185 | ) |
| 186 | } |
| 187 | |
| 188 | const ToggleValueButton = (props: { |
| 189 | dataPath: Array<string> |
nothing calls this directly
no test coverage detected