1+ import { reactNode , validateProps } from '@msinternal/botframework-webchat-react-valibot' ;
12import { useStyles } from '@msinternal/botframework-webchat-styles/react' ;
23import 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
57import 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) => {
2433StackedLayoutStatus . displayName = 'StackedLayoutStatus' ;
2534
2635export default StackedLayoutStatus ;
36+ export { stackedLayoutStatusPropsSchema , type StackedLayoutStatusProps } ;
0 commit comments