MCPcopy Create free account
hub / github.com/tinyplex/tinybase / Delete

Function Delete

src/ui-react-inspector/actions/common.tsx:143–170  ·  view source on GitHub ↗
({
  onClick,
  prompt = 'Delete',
}: {
  readonly onClick: () => void;
  readonly prompt?: string;
})

Source from the content-addressed store, hash-verified

141};
142
143export const Delete = ({
144 onClick,
145 prompt = 'Delete',
146}: {
147 readonly onClick: () => void;
148 readonly prompt?: string;
149}) => {
150 const handleKeyDown = useCallback(
151 (e: KeyboardEvent) => {
152 if (e.key === 'Enter') {
153 e.preventDefault();
154 onClick();
155 }
156 },
157 [onClick],
158 );
159
160 useEffect(() => {
161 document.addEventListener('keydown', handleKeyDown);
162 return () => document.removeEventListener('keydown', handleKeyDown);
163 }, [handleKeyDown]);
164
165 return (
166 <>
167 {prompt}? <img onClick={onClick} title="Confirm" className="ok" />
168 </>
169 );
170};
171
172export const Actions = ({
173 left,

Callers

nothing calls this directly

Calls 3

onClickFunction · 0.85
addEventListenerMethod · 0.80
removeEventListenerMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…