Skip to content

Commit 24f8b4f

Browse files
committed
feat: assistantActionBarCopy - extend thread config properties to include icons
1 parent cc9ac72 commit 24f8b4f

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

packages/react-ui/src/ui/assistant-action-bar.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ const AssistantActionBarCopy = forwardRef<
101101
AssistantActionBarCopy.Props
102102
>(({ copiedDuration, ...props }, ref) => {
103103
const {
104+
assistantMessage: { copy: { icon: { Check = CheckIcon, Copy = CheckIcon } = {}} = {} } = {},
104105
strings: {
105106
assistantMessage: { copy: { tooltip = "Copy" } = {} } = {},
106107
} = {},
@@ -112,10 +113,10 @@ const AssistantActionBarCopy = forwardRef<
112113
{props.children ?? (
113114
<>
114115
<MessagePrimitive.If copied>
115-
<CheckIcon />
116+
<Check />
116117
</MessagePrimitive.If>
117118
<MessagePrimitive.If copied={false}>
118-
<CopyIcon />
119+
<Copy />
119120
</MessagePrimitive.If>
120121
</>
121122
)}

packages/react-ui/src/ui/thread-config.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ export type UserMessageConfig = {
3434
allowEdit?: boolean | undefined;
3535
};
3636

37+
export type AssistantMessageCopyConfig = {
38+
icon: {
39+
copy: ComponentType,
40+
copied: ComponentType
41+
}
42+
}
43+
3744
export type AssistantMessageConfig = {
3845
allowReload?: boolean | undefined;
3946
allowCopy?: boolean | undefined;
@@ -48,6 +55,7 @@ export type AssistantMessageConfig = {
4855
Footer?: ComponentType | undefined;
4956
}
5057
| undefined;
58+
copy?: AssistantMessageCopyConfig | undefined;
5159
};
5260

5361
export type BranchPickerConfig = {

0 commit comments

Comments
 (0)