inspector app uses new JS client

This commit is contained in:
Brandon Liu
2022-10-05 10:48:00 +08:00
parent f831dd113a
commit d8851a7041
5 changed files with 114 additions and 104 deletions

View File

@@ -1,7 +1,7 @@
import { useState, Dispatch, SetStateAction, useCallback } from "react";
import maplibregl from "maplibre-gl";
import L from "leaflet";
import { PMTiles, FileSource } from "../../js";
import { PMTiles, FileAPISource } from "../../js";
import { styled } from "./stitches.config";
import { useDropzone } from "react-dropzone";
@@ -107,8 +107,9 @@ const EXAMPLE_FILES = [
function Start(props: {
setFile: Dispatch<SetStateAction<PMTiles | undefined>>;
}) {
const onDrop = useCallback((acceptedFiles: File[]) => {
props.setFile(new PMTiles(new FileSource(acceptedFiles[0])));
props.setFile(new PMTiles(new FileAPISource(acceptedFiles[0])));
}, []);
const { acceptedFiles, getRootProps, getInputProps } = useDropzone({