mirror of
https://github.com/baptisteArno/typebot.io.git
synced 2026-06-19 21:04:33 +08:00
🚸 Improve Google Sheets picker to filter spreadsheet files
This commit is contained in:
parent
f2512eb471
commit
e70ddd95d2
@ -6,7 +6,6 @@ import { isDefined } from "@typebot.io/lib/utils";
|
||||
import React, { useEffect, useState } from "react";
|
||||
import { GoogleSheetsLogo } from "./GoogleSheetsLogo";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
declare const window: any;
|
||||
|
||||
type Props = {
|
||||
@ -72,7 +71,11 @@ export const GoogleSpreadsheetPicker = ({
|
||||
if (!isPickerInitialized) throw new Error("Google Picker not inited");
|
||||
|
||||
const picker = new window.google.picker.PickerBuilder()
|
||||
.addView(window.google.picker.ViewId.SPREADSHEETS)
|
||||
.addView(
|
||||
new window.google.picker.View(
|
||||
window.google.picker.ViewId.SPREADSHEETS,
|
||||
).setMimeTypes("application/vnd.google-apps.spreadsheet"),
|
||||
)
|
||||
.setOAuthToken(data.accessToken)
|
||||
.setDeveloperKey(env.NEXT_PUBLIC_GOOGLE_SHEETS_API_KEY)
|
||||
.setCallback(pickerCallback)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user