Skip to content

Commit

Permalink
fix(manager-components): region component exports (#12920)
Browse files Browse the repository at this point in the history
ref: 12918

Signed-off-by: Paul Dickerson <[email protected]>
  • Loading branch information
pauldkn authored Sep 2, 2024
1 parent e69681f commit 592a35e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions packages/manager-components/src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ export * from './ManagerButton/ManagerButton';
export * from './ManagerText/ManagerText';

export * from './pci-maintenance-banner';
export * from './region/region.component';
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import './translations/region';
import './translations/datacenter';
Expand All @@ -8,10 +9,12 @@ export interface RegionProps {
micro?: number;
}

export function Region({ mode = 'region', name, micro }: RegionProps) {
export const Region: React.FC<RegionProps> = ({
mode = 'region',
name,
micro,
}: RegionProps) => {
const { t } = useTranslation(mode === 'region' ? 'region' : 'datacenter');

return <>{t(`region_${name}`, { micro })}</>;
}

export default Region;
};
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { screen } from '@testing-library/react';
import { render } from '../../utils/test.provider';
import Region, { RegionProps } from './region.component';
import { Region, RegionProps } from './region.component';
import { DemoRegion, DemoDatacenter } from './region.stories';
import translatedRegion from './translations/region/Messages_fr_FR.json';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Story } from '@storybook/react';
import Region from './region.component';
import { Region } from './region.component';

const managerRegion = {
title: 'Components/Region',
Expand Down

0 comments on commit 592a35e

Please sign in to comment.