import { CanvasGrid, SpreadsheetProvider } from "@rowsncolumns/spreadsheet"
import { useSpreadsheet, InsertLinkDialog, InsertLinkEditor } from "@rowsncolumns/spreadsheet-state"
const Spreadsheet = () => {
const {
activeSheetId,
activeCell,
selections,
onInsertLink,
onRequestInsertLink
} = useSpreadsheetState({})
return (
<>
<button onClick={() => onRequestInsertLink()}>Insert link</button>
<InsertLinkDialog>
<InsertLinkEditor
sheetId={activeSheetId}
activeCell={activeCell}
selections={selections}
onInsertLink={onInsertLink}
/>
</InsertLinkDialog>
</>
)
}
const App = () => (
<SpreadsheetProvider>
<Spreadsheet />
</SpreadsheetProvider>
)