Skip to content

Commit f192415

Browse files
authoredNov 22, 2024··
Merge pull request #822 from sudhanshutech/prompt/headericon
add headericon for prompt
2 parents 01959f7 + 49a2ccb commit f192415

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed
 

‎src/custom/Prompt/promt-component.tsx

+6-3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ interface State {
2525
primaryOption: string;
2626
showInfoIcon?: string;
2727
variant?: PromptVariant;
28+
headerIcon?: React.ReactNode;
2829
}
2930

3031
interface ShowParams {
@@ -33,6 +34,7 @@ interface ShowParams {
3334
primaryOption: string;
3435
variant: PromptVariant;
3536
showInfoIcon?: string;
37+
headerIcon?: React.ReactNode;
3638
}
3739

3840
export interface PromptRef {
@@ -46,7 +48,8 @@ const PromptComponent = forwardRef<PromptRef, PromptProps>(({ variant }, ref) =>
4648
subtitle: '',
4749
primaryOption: '',
4850
showInfoIcon: '',
49-
variant
51+
variant,
52+
headerIcon: undefined
5053
});
5154

5255
/* 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<PromptRef, PromptProps>(({ variant }, ref) =>
7881
show
7982
}));
8083

81-
const { isOpen, primaryOption, title, subtitle, showInfoIcon } = state;
84+
const { isOpen, primaryOption, title, subtitle, showInfoIcon, headerIcon } = state;
8285
const { resolve } = promiseInfoRef.current;
8386

8487
return (
@@ -87,7 +90,7 @@ const PromptComponent = forwardRef<PromptRef, PromptProps>(({ variant }, ref) =>
8790
closeModal={hide}
8891
title={title}
8992
id="searchClick"
90-
headerIcon={undefined}
93+
headerIcon={headerIcon}
9194
reactNode={undefined}
9295
>
9396
{subtitle && (

0 commit comments

Comments
 (0)
Please sign in to comment.