Skip to content

Commit

Permalink
feat(editor): ♿️ Indicate why GSheets couldn't find any sheet
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Jul 3, 2022
1 parent cc71157 commit 6b32c17
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Input } from '@chakra-ui/react'
import { HStack, Input } from '@chakra-ui/react'
import { MoreInfoTooltip } from 'components/shared/MoreInfoTooltip'
import { SearchableDropdown } from 'components/shared/SearchableDropdown'
import { useMemo } from 'react'
import { Sheet } from 'services/integrations'
Expand Down Expand Up @@ -28,7 +29,16 @@ export const SheetsDropdown = ({
}

if (isLoading) return <Input value="Loading..." isDisabled />
if (!sheets) return <Input value="No sheets found" isDisabled />
if (!sheets || sheets.length === 0)
return (
<HStack>
<Input value="No sheets found" isDisabled />
<MoreInfoTooltip>
Make sure your spreadsheet contains at least a sheet with a header
row.
</MoreInfoTooltip>
</HStack>
)
return (
<SearchableDropdown
selectedItem={currentSheet?.name}
Expand Down

0 comments on commit 6b32c17

Please sign in to comment.