From 49a2ccb992e25a5192501c6e88c82da98777a3d8 Mon Sep 17 00:00:00 2001 From: Sudhanshu Dasgupta Date: Fri, 22 Nov 2024 18:13:20 +0530 Subject: [PATCH] feat(icon): headericon for prompt Signed-off-by: Sudhanshu Dasgupta --- src/custom/Prompt/promt-component.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/custom/Prompt/promt-component.tsx b/src/custom/Prompt/promt-component.tsx index 44022d73..90824d95 100644 --- a/src/custom/Prompt/promt-component.tsx +++ b/src/custom/Prompt/promt-component.tsx @@ -25,6 +25,7 @@ interface State { primaryOption: string; showInfoIcon?: string; variant?: PromptVariant; + headerIcon?: React.ReactNode; } interface ShowParams { @@ -33,6 +34,7 @@ interface ShowParams { primaryOption: string; variant: PromptVariant; showInfoIcon?: string; + headerIcon?: React.ReactNode; } export interface PromptRef { @@ -46,7 +48,8 @@ const PromptComponent = forwardRef(({ variant }, ref) => subtitle: '', primaryOption: '', showInfoIcon: '', - variant + variant, + headerIcon: undefined }); /* This ref is used to store the resolve and reject functions of the promise returned by the show method */ @@ -78,7 +81,7 @@ const PromptComponent = forwardRef(({ variant }, ref) => show })); - const { isOpen, primaryOption, title, subtitle, showInfoIcon } = state; + const { isOpen, primaryOption, title, subtitle, showInfoIcon, headerIcon } = state; const { resolve } = promiseInfoRef.current; return ( @@ -87,7 +90,7 @@ const PromptComponent = forwardRef(({ variant }, ref) => closeModal={hide} title={title} id="searchClick" - headerIcon={undefined} + headerIcon={headerIcon} reactNode={undefined} > {subtitle && (