Skip to content

Commit

Permalink
refactor(SkeletonPlaceholder): convert SkeletonPlaceholder to TypeScr…
Browse files Browse the repository at this point in the history
…ipt (#14501)
  • Loading branch information
lewandom authored Aug 24, 2023
1 parent b46160c commit 493ac04
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,24 @@ import PropTypes from 'prop-types';
import classNames from 'classnames';
import { usePrefix } from '../../internal/usePrefix';

const SkeletonPlaceholder = ({ className, ...other }) => {
export interface SkeletonPlaceholderProps {
/**
* Add a custom class to the component to set the height and width
*/
className?: string;
}

const SkeletonPlaceholder = ({
className,
...other
}: SkeletonPlaceholderProps) => {
const prefix = usePrefix();
const skeletonPlaceholderClasses = classNames({
[`${prefix}--skeleton__placeholder`]: true,
[className]: className,
});
const skeletonPlaceholderClasses = classNames(
{
[`${prefix}--skeleton__placeholder`]: true,
},
className
);

return <div className={skeletonPlaceholderClasses} {...other} />;
};
Expand Down

0 comments on commit 493ac04

Please sign in to comment.