From 391c8e4b47d2bd4058b0e95e1f03c62c65817bf8 Mon Sep 17 00:00:00 2001 From: Steven Black Date: Tue, 12 Sep 2023 08:25:01 -0400 Subject: [PATCH] refactor(IconSkeleton): convert to TypeScript (#14636) Co-authored-by: Andrea N. Cardona --- .../Icon/{Icon.Skeleton.js => Icon.Skeleton.tsx} | 16 ++++++++++------ .../src/components/Icon/{index.js => index.ts} | 0 2 files changed, 10 insertions(+), 6 deletions(-) rename packages/react/src/components/Icon/{Icon.Skeleton.js => Icon.Skeleton.tsx} (67%) rename packages/react/src/components/Icon/{index.js => index.ts} (100%) diff --git a/packages/react/src/components/Icon/Icon.Skeleton.js b/packages/react/src/components/Icon/Icon.Skeleton.tsx similarity index 67% rename from packages/react/src/components/Icon/Icon.Skeleton.js rename to packages/react/src/components/Icon/Icon.Skeleton.tsx index 8c7947c52ec6..f2ce86af20fc 100644 --- a/packages/react/src/components/Icon/Icon.Skeleton.js +++ b/packages/react/src/components/Icon/Icon.Skeleton.tsx @@ -6,18 +6,22 @@ */ import PropTypes from 'prop-types'; -import React from 'react'; +import React, { ComponentProps } from 'react'; import cx from 'classnames'; import { usePrefix } from '../../internal/usePrefix'; -const IconSkeleton = ({ className, ...rest }) => { +export interface IconSkeletonProps extends ComponentProps<'div'> { + /** + * Specify an optional className to add. + */ + className?: string; +} + +const IconSkeleton = ({ className, ...rest }: IconSkeletonProps) => { const prefix = usePrefix(); - const props = { - ...rest, - }; return ( -
+
); }; diff --git a/packages/react/src/components/Icon/index.js b/packages/react/src/components/Icon/index.ts similarity index 100% rename from packages/react/src/components/Icon/index.js rename to packages/react/src/components/Icon/index.ts