Fixed region rendering.

This commit is contained in:
Mike Cao 2023-08-25 17:44:16 -07:00
parent befafaf1ee
commit 0fdc8f7922

View File

@ -14,7 +14,9 @@ export function RegionsTable({ websiteId, ...props }) {
const { basePath } = useRouter();
const renderLabel = x => {
return regions[x] ? `${regions[x]}, ${countryNames[x.split('-')[0]]}` : x;
const [country, ...codes] = x.split('-');
const region = codes.join('-');
return regions[region] ? `${regions[region]}, ${countryNames[country]}` : x;
};
const renderLink = ({ x: code }) => {