forked from carbon-design-system/carbon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChatButton.Skeleton.js
38 lines (32 loc) · 951 Bytes
/
ChatButton.Skeleton.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* Copyright IBM Corp. 2022
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import PropTypes from 'prop-types';
import React from 'react';
import cx from 'classnames';
import { usePrefix } from '../../internal/usePrefix';
const ChatButtonSkeleton = ({ className, size, ...rest }) => {
const prefix = usePrefix();
const skeletonClasses = cx(
className,
`${prefix}--skeleton`,
`${prefix}--btn`,
`${prefix}--chat-btn`,
{ [`${prefix}--layout--size-${size}`]: size }
);
return <div className={skeletonClasses} {...rest} />;
};
ChatButtonSkeleton.propTypes = {
/**
* Specify an optional className to add.
*/
className: PropTypes.string,
/**
* Specify the size of the `ChatButtonSkeleton`, from the following list of sizes:
*/
size: PropTypes.oneOf(['sm', 'md', 'lg']),
};
export default ChatButtonSkeleton;