Skip to content

Commit 721b365

Browse files
committed
Add props schema
1 parent 4847db0 commit 721b365

3 files changed

Lines changed: 17 additions & 5 deletions

File tree

packages/component/src/Activity/StackedLayoutMain.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ type StackedLayoutMainProps = InferOutput<typeof stackedLayoutMainPropsSchema>;
1818

1919
const StackedLayoutMain = memo((props: StackedLayoutMainProps) => {
2020
const { avatar, children } = validateProps(stackedLayoutMainPropsSchema, props);
21+
2122
const classNames = useStyles(styles);
2223

2324
return (

packages/component/src/Activity/StackedLayoutRoot.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const StackedLayoutRoot = memo((props: StackedLayoutRootProps) => {
3939
showNub,
4040
topCallout
4141
} = validateProps(stackedLayoutRootPropsSchema, props);
42+
4243
const classNames = useStyles(styles);
4344

4445
return (

packages/component/src/Activity/StackedLayoutStatus.tsx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
1+
import { reactNode, validateProps } from '@msinternal/botframework-webchat-react-valibot';
12
import { useStyles } from '@msinternal/botframework-webchat-styles/react';
23
import cx from 'classnames';
3-
import React, { memo, type ReactNode } from 'react';
4+
import React, { memo } from 'react';
5+
import { object, optional, pipe, readonly, type InferInput } from 'valibot';
46

57
import styles from './StackedLayout.module.css';
68

7-
type StackedLayoutStatusProps = Readonly<{
8-
children?: ReactNode | undefined;
9-
}>;
9+
const stackedLayoutStatusPropsSchema = pipe(
10+
object({
11+
children: optional(reactNode())
12+
}),
13+
readonly()
14+
);
15+
16+
type StackedLayoutStatusProps = InferInput<typeof stackedLayoutStatusPropsSchema>;
17+
18+
const StackedLayoutStatus = memo((props: StackedLayoutStatusProps) => {
19+
const { children } = validateProps(stackedLayoutStatusPropsSchema, props);
1020

11-
const StackedLayoutStatus = memo(({ children }: StackedLayoutStatusProps) => {
1221
const classNames = useStyles(styles);
1322

1423
return (
@@ -24,3 +33,4 @@ const StackedLayoutStatus = memo(({ children }: StackedLayoutStatusProps) => {
2433
StackedLayoutStatus.displayName = 'StackedLayoutStatus';
2534

2635
export default StackedLayoutStatus;
36+
export { stackedLayoutStatusPropsSchema, type StackedLayoutStatusProps };

0 commit comments

Comments
 (0)