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 , { Fragment , memo , type ReactNode } from 'react' ;
4+ import React , { Fragment , memo } from 'react' ;
5+ import { boolean , object , optional , pipe , readonly , string , type InferInput } from 'valibot' ;
46
57import { useVariantClassName } from '../../styles' ;
68import SlidingDots from '../assets/SlidingDots' ;
79import styles from './ActivityLoader.module.css' ;
810
9- function FluentActivityLoader ( {
10- children,
11- className,
12- showLoader = true
13- } : Readonly < { children ?: ReactNode | undefined ; className ?: string | undefined ; showLoader ?: boolean } > ) {
11+ const fluentActivityLoaderPropsSchema = pipe (
12+ object ( {
13+ children : optional ( reactNode ( ) ) ,
14+ className : optional ( string ( ) ) ,
15+ showLoader : optional ( boolean ( ) , true )
16+ } ) ,
17+ readonly ( )
18+ ) ;
19+
20+ type FluentActivityLoaderProps = InferInput < typeof fluentActivityLoaderPropsSchema > ;
21+
22+ function FluentActivityLoader ( props : FluentActivityLoaderProps ) {
23+ const { children, className, showLoader } = validateProps ( fluentActivityLoaderPropsSchema , props ) ;
24+
1425 const classNames = useStyles ( styles ) ;
1526 const variantClassName = useVariantClassName ( classNames ) ;
1627
@@ -23,3 +34,4 @@ function FluentActivityLoader({
2334}
2435
2536export default memo ( FluentActivityLoader ) ;
37+ export { fluentActivityLoaderPropsSchema , type FluentActivityLoaderProps } ;
0 commit comments