Skip to content

Commit 10c5b16

Browse files
authored
chore: Add jsDocs for PlatformSection and PlatformCategorySection (#12642)
1 parent 24b3e3b commit 10c5b16

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

src/components/platformCategorySection.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,19 @@ const isSupported = (
3232
return true;
3333
};
3434

35+
/**
36+
* Conditionally renders children based on platform categories.
37+
* It filters content by checking if the current platform
38+
* or guide matches the specified supported/not supported categories.
39+
*
40+
* @param supported - Array of platform categories that should show this content
41+
* @param notSupported - Array of platform categories that should not show this content
42+
* @param noGuides - If true, content will not be shown for platform guides
43+
* @param children - Content to be conditionally rendered
44+
*
45+
* For filtering by platform categories,
46+
* use PlatformCategorySection instead of PlatformSection.
47+
*/
3548
export function PlatformCategorySection({
3649
supported = [],
3750
notSupported = [],

src/components/platformSection.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@ const isSupported = (
3737
return null;
3838
};
3939

40+
/**
41+
* Conditionally renders children based on the current platform or guide.
42+
*
43+
* @param supported - Array of platform/guide keys that should show this content
44+
* @param notSupported - Array of platform/guide keys that should not show this content
45+
* @param noGuides - If true, content will not be shown for platform guides
46+
* @param children - Content to be conditionally rendered
47+
* @param platform - (Optional) Override the current platform
48+
*
49+
* Note: This component checks against platform and guide keys (e.g. 'python', 'react').
50+
* For filtering by platform categories (e.g. 'browser', 'node'),
51+
* use PlatformCategorySection instead.
52+
*/
4053
export function PlatformSection({
4154
supported = [],
4255
notSupported = [],

0 commit comments

Comments
 (0)