|
1
|
import { useParams } from "react-router-dom" |
|
2
|
|
|
3
|
import { useTaxRegion } from "../../../hooks/api" |
|
4
|
import { MetadataForm } from "../../../components/forms/metadata-form" |
|
5
|
import { RouteDrawer } from "../../../components/modals" |
|
6
|
|
|
7
|
/** |
|
8
|
* TODO: Tax region update endpoint is missing |
|
9
|
*/ |
|
10
|
|
|
11
|
export const TaxRegionMetadata = () => { |
|
12
|
const { id } = useParams() |
|
13
|
|
|
14
|
const { tax_region, isPending, isError, error } = useTaxRegion(id ?? "") |
|
15
|
const { mutateAsync, isPending: isMutating } = {} as any // useUpdateTaxRegion(id) |
|
16
|
|
|
17
|
if (isError) { |
|
18
|
throw error |
|
19
|
} |
|
20
|
|
|
21
|
return ( |
|
22
|
<RouteDrawer> |
|
23
|
<MetadataForm |
|
24
|
isPending={isPending} |
|
25
|
isMutating={isMutating} |
|
26
|
hook={mutateAsync} |
|
27
|
metadata={tax_region?.metadata} |
|
28
|
/> |
|
29
|
</RouteDrawer> |
|
30
|
) |
|
31
|
} |