Skip to content

Commit 797198a

Browse files
committed
Add comment
1 parent b979c0a commit 797198a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

packages/fluent-theme/src/components/activity/private/useActivityAuthor.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ import { orgSchemaPersonSchema, type OrgSchemaPerson } from 'botframework-webcha
33
import { useMemo } from 'react';
44
import { parse } from 'valibot';
55

6+
/**
7+
* Returns the first `Message.author` if it is of type `Person` or `string`.
8+
*
9+
* String-based author will be convertewd to `Person` thing.
10+
*/
611
export default function useActivityAuthor(activity?: WebChatActivity | undefined): OrgSchemaPerson | undefined {
712
return useMemo(() => {
813
const firstAuthor = getOrgSchemaMessage(activity?.entities || [])?.author[0];

0 commit comments

Comments
 (0)