From d9554b145904d0eb2883d61b8f1cd4d7f0c6e9dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20D=C3=ADaz=20Gonz=C3=A1lez?= Date: Tue, 29 Oct 2024 10:20:56 +0000 Subject: [PATCH] fix(web) use right type for icon name at EmptyState It was broken when migration layout/Icon.jsx to layout/Icon.tsx in https://github.com/agama-project/agama/pull/1690 --- web/src/components/core/EmptyState.jsx | 4 ++-- web/src/components/layout/Icon.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web/src/components/core/EmptyState.jsx b/web/src/components/core/EmptyState.jsx index 056ca56e8a..72c69802ad 100644 --- a/web/src/components/core/EmptyState.jsx +++ b/web/src/components/core/EmptyState.jsx @@ -34,7 +34,7 @@ import { import { Icon } from "~/components/layout"; /** - * @typedef {import("~/components/layout/Icon").IconName} IconName + * @typedef {import("~/components/layout/Icon").IconProps} IconProps * @typedef {import("@patternfly/react-core").EmptyStateProps} EmptyStateProps * @typedef {import("@patternfly/react-core").EmptyStateHeaderProps} EmptyStateHeaderProps */ @@ -48,7 +48,7 @@ import { Icon } from "~/components/layout"; * * @param {object} props * @param {string} props.title - * @param {IconName} props.icon + * @param {IconProps["name"]} props.icon * @param {string} [props.color="color-100"] * @param {EmptyStateHeaderProps["headingLevel"]} [props.headingLevel="h4"] * @param {boolean} [props.noPadding=false] diff --git a/web/src/components/layout/Icon.tsx b/web/src/components/layout/Icon.tsx index acab440e37..6612381b44 100644 --- a/web/src/components/layout/Icon.tsx +++ b/web/src/components/layout/Icon.tsx @@ -152,7 +152,7 @@ const icons = { const PREDEFINED_SIZES = ["xxxs", "xxs", "xs", "s", "m", "l", "xl", "xxl", "xxxl"]; -type IconProps = React.SVGAttributes & { +export type IconProps = React.SVGAttributes & { /** Name of the desired icon */ name: keyof typeof icons; /** Size used for both, width and height.It can be a CSS unit or one of PREDEFINED_SIZES */