Skip to content

Commit ed253f5

Browse files
committed
Add props schema
1 parent 27c0ffd commit ed253f5

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
1+
import { validateProps } from '@msinternal/botframework-webchat-react-valibot';
12
import { useStyles } from '@msinternal/botframework-webchat-styles/react';
23
import cx from 'classnames';
34
import React, { memo } from 'react';
5+
import { object, optional, pipe, readonly, string, type InferInput } from 'valibot';
46

5-
import styles from './MessageStatusLoader.module.css';
67
import { ComponentIcon } from '../../Icon';
8+
import styles from './MessageStatusLoader.module.css';
9+
10+
const messageStatusLoaderPropsSchema = pipe(
11+
object({
12+
className: optional(string())
13+
}),
14+
readonly()
15+
);
716

8-
function MessageStatusLoader({ className }: Readonly<{ className?: string | undefined }>) {
17+
type MessageStatusLoaderProps = InferInput<typeof messageStatusLoaderPropsSchema>;
18+
19+
function MessageStatusLoader(props: MessageStatusLoaderProps) {
20+
const { className } = validateProps(messageStatusLoaderPropsSchema, props);
921
const classNames = useStyles(styles);
22+
1023
return <ComponentIcon appearance="text" className={cx(classNames['message-status-loader'], className)} />;
1124
}
1225

1326
export default memo(MessageStatusLoader);
27+
export { messageStatusLoaderPropsSchema, type MessageStatusLoaderProps };

0 commit comments

Comments
 (0)