1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-25 23:44:01 +02:00

fix(storybook): implement missing stories (#15862)

This commit is contained in:
zyoshoka
2025-04-18 18:56:46 +09:00
committed by GitHub
parent 74d9cc4e38
commit 978ab2f848
3 changed files with 87 additions and 0 deletions

View File

@@ -43,6 +43,41 @@ export function channel(id = 'somechannelid', name = 'Some Channel', bannerUrl:
};
}
export function chatMessage(room = false, id = 'somechatmessageid', text = 'Hello!'): entities.ChatMessage {
const fromUser = userLite();
const toRoom = chatRoom();
const toUser = userLite('touserid');
return {
id,
createdAt: '2016-12-28T22:49:51.000Z',
fromUserId: fromUser.id,
fromUser,
text,
isRead: false,
reactions: [],
...room ? {
toRoomId: toRoom.id,
toRoom,
} : {
toUserId: toUser.id,
toUser,
},
};
}
export function chatRoom(id = 'somechatroomid', name = 'Some Chat Room'): entities.ChatRoom {
const owner = userLite('someownerid');
return {
id,
createdAt: '2016-12-28T22:49:51.000Z',
ownerId: owner.id,
owner,
name,
description: 'A chat room for testing',
isMuted: false,
};
}
export function clip(id = 'someclipid', name = 'Some Clip'): entities.Clip {
return {
id,