import{useState,useEffect}from"react";import{useAtom}from"jotai";import{operationStore}from"../../jotai/operation";export function useExampleKey({pointer:e}={},t){const[o,a]=useAtom(operationStore(e)),{activeExampleName:r}=o,[i,m]=useState(r&&t[r]?r:Object.keys(t)[0]);return useEffect((()=>{r&&t[r]&&(m(r),a((e=>Object.assign(Object.assign({},e),{activeExampleName:r}))))}),[r,t,a]),{exampleKey:t[i]?i:Object.keys(t)[0]}}
//# sourceMappingURL=use-example-key.js.map