|
1
|
import { Heading } from "@medusajs/ui" |
|
2
|
import { Spinner } from "@medusajs/icons" |
|
3
|
import { RouteDrawer } from "../../../components/modals" |
|
4
|
import { useTranslationSettings } from "../../../hooks/api/translations" |
|
5
|
import { BatchTranslationSettingsForm } from "./components/batch-translation-settings-form/batch-translation-settings-form" |
|
6
|
|
|
7
|
export const Settings = () => { |
|
8
|
const { translation_settings, isPending, isError, error } = |
|
9
|
useTranslationSettings() |
|
10
|
|
|
11
|
if (isError) { |
|
12
|
throw error |
|
13
|
} |
|
14
|
|
|
15
|
return ( |
|
16
|
<RouteDrawer> |
|
17
|
<RouteDrawer.Header> |
|
18
|
<RouteDrawer.Title asChild> |
|
19
|
<Heading>Manage translatable entities</Heading> |
|
20
|
</RouteDrawer.Title> |
|
21
|
</RouteDrawer.Header> |
|
22
|
{isPending ? ( |
|
23
|
<RouteDrawer.Body className="flex h-full items-center justify-center"> |
|
24
|
<Spinner className="animate-spin" /> |
|
25
|
</RouteDrawer.Body> |
|
26
|
) : ( |
|
27
|
translation_settings && ( |
|
28
|
<BatchTranslationSettingsForm |
|
29
|
translation_settings={translation_settings} |
|
30
|
/> |
|
31
|
) |
|
32
|
)} |
|
33
|
</RouteDrawer> |
|
34
|
) |
|
35
|
} |