import { createContext, useContext } from 'react' /** * Present (true) below a `` wrapper — `Legend.Group` / * `Legend.Row` read it to become draggable (sortable shell + drag handle). */ export const LegendSortableContext = createContext(false) /** Whether the nearest legend composition is wrapped in `Legend.Sortable`. */ export function useLegendSortable(): boolean { return useContext(LegendSortableContext) }