Skip to content

Commit 0492f97

Browse files
committed
pr fixes
1 parent cf1a874 commit 0492f97

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

src/components/platformCategorySection.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ const isSupported = (
1919
return false;
2020
}
2121

22-
const categories = (platformOrGuide.categories ||
23-
[]) as unknown as `${PlatformCategory}`;
22+
const categories = platformOrGuide.categories || [];
2423

2524
if (supported.length && !supported.some(v => categories.includes(v))) {
2625
return false;

src/components/sdkOption/index.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {PlatformSection} from '../platformSection';
1010
type Props = {
1111
name: string;
1212
type: string;
13-
categorySupported?: `${PlatformCategory}`[];
13+
categorySupported?: PlatformCategory[];
1414
children?: React.ReactNode;
1515
defaultValue?: string;
1616
envVar?: string;
@@ -25,7 +25,6 @@ export function SdkOption({
2525
envVar,
2626
categorySupported = [],
2727
}: Props) {
28-
2928
const {showBrowserOnly, showServerLikeOnly} = getPlatformHints(categorySupported);
3029

3130
return (
@@ -102,7 +101,7 @@ export function SdkOption({
102101
);
103102
}
104103

105-
function getPlatformHints(categorySupported: `${PlatformCategory}`[]) {
104+
function getPlatformHints(categorySupported: PlatformCategory[]) {
106105
const {rootNode, path} = serverContext();
107106
const currentPlatformOrGuide = getCurrentPlatformOrGuide(rootNode, path);
108107
const currentCategories = currentPlatformOrGuide?.categories || [];

src/types/platform.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export interface PlatformConfig {
104104
/**
105105
* The categories the platform belongs to.
106106
*/
107-
categories?: `${PlatformCategory}`[];
107+
categories?: PlatformCategory[];
108108
/**
109109
* Useful to define the "parent" platform. When specified the Platform will
110110
* inherit configuration values from the parent platform.

0 commit comments

Comments
 (0)