import { useBooleanKnob, useRangeKnob } from '@fluentui/docs-components';
import { Avatar, Chat, ChatMessageProps, ChatProps, MenuButton } from '@fluentui/react-northstar';
import * as React from 'react';
import {
AddIcon,
BanIcon,
BookmarkIcon,
BroadcastIcon,
CalendarIcon,
CloseIcon,
EditIcon,
LikeIcon,
LockIcon,
MoreIcon,
StarIcon,
ReplyIcon,
} from '@fluentui/react-icons-northstar';
const ChatExampleInScrollableShorthand = () => {
const [actionCount, setActionCount] = useRangeKnob({ name: 'actionCount', initialValue: 7, min: 1, max: 10 });
const [overflow] = useBooleanKnob({ name: 'overflow', initialValue: true });
const [height] = useRangeKnob({
name: 'height',
initialValue: '300px',
min: '200px',
max: '800px',
step: 10,
});
const [width] = useRangeKnob({
name: 'width',
initialValue: '500px',
min: '100px',
max: '500px',
step: 10,
});
const actionItems = [
{ key: 'add', icon: , title: 'Add' },
{ key: 'ban', icon: , title: 'Ban' },
{ key: 'bookmark', icon: , title: 'Bookmark' },
{ key: 'broadcast', icon: , title: 'Broadcast' },
{ key: 'calendar', icon: , title: 'Calendar' },
{ key: 'like', icon: , title: 'Like' },
{ key: 'star', icon: , title: 'Star' },
{ key: 'edit', icon: , title: 'Edit' },
{ key: 'lock', icon: , title: 'Lock' },
{
key: 'more',
icon: ,
title: 'More actions',
children: (Component, props) => (
},
{ key: 'edit', content: 'Edit', icon: },
{ key: 'save', content: 'Save message', icon: },
{ key: 'delete', content: 'Delete', icon: },
]}
position="above"
trigger={}
{...(overflow && {
flipBoundary: 'window',
overflowBoundary: 'window',
})}
/>
),
},
];
const actionMenu: ChatMessageProps['actionMenu'] = {
iconOnly: true,
items: actionItems.slice(-actionCount),
};
const items: ChatProps['items'] = [
{
attached: 'top',
contentPosition: 'end',
message: (
),
key: 'message-1',
},
{
attached: 'bottom',
contentPosition: 'end',
key: 'message-2',
message: (
),
},
{
gutter: ,
message: (
),
key: 'message-3',
},
{
attached: true,
message: (
),
key: 'message-4',
},
{
attached: 'bottom',
message: (
),
key: 'message-5',
},
{
attached: 'top',
contentPosition: 'end',
message: (
),
key: 'message-6',
},
{
attached: 'bottom',
contentPosition: 'end',
key: 'message-7',
message: (
Please order a{' '}
🍕
{' '}
for me
>
}
mine
timestamp="Yesterday, 10:16 PM"
unstable_overflow={overflow}
/>
),
},
{
message: (
),
key: 'message-8',
},
];
return (
<>
>
);
};
export default ChatExampleInScrollableShorthand;