@sanity/document-internationalization 2.0.0-studio-v3-plugin-v2.13 → 2.0.0-studio-v3-plugin-v2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import {CogIcon} from '@sanity/icons'
2
- import {Button} from '@sanity/ui'
2
+ import {Box, Button, Stack, Text, Tooltip} from '@sanity/ui'
3
3
 
4
4
  import {METADATA_SCHEMA_NAME} from '../constants'
5
5
  import {useOpenInNewPane} from '../hooks/useOpenInNewPane'
@@ -13,12 +13,29 @@ export default function LanguageManage(props: LanguageManageProps) {
13
13
  const open = useOpenInNewPane(id, METADATA_SCHEMA_NAME)
14
14
 
15
15
  return (
16
- <Button
17
- disabled={!id}
18
- mode="ghost"
19
- text="Manage Translations"
20
- icon={CogIcon}
21
- onClick={() => open()}
22
- />
16
+ <Tooltip
17
+ content={
18
+ id ? null : (
19
+ <Box padding={2}>
20
+ <Text muted size={1}>
21
+ Document has no other translations
22
+ </Text>
23
+ </Box>
24
+ )
25
+ }
26
+ fallbackPlacements={['right', 'left']}
27
+ placement="top"
28
+ portal
29
+ >
30
+ <Stack>
31
+ <Button
32
+ disabled={!id}
33
+ mode="ghost"
34
+ text="Manage Translations"
35
+ icon={CogIcon}
36
+ onClick={() => open()}
37
+ />
38
+ </Stack>
39
+ </Tooltip>
23
40
  )
24
41
  }