|
| 1 | +const getTimestamp = function (date, offsetMinutes = 0) { |
| 2 | + return date.getTime() + offsetMinutes * 60000; |
| 3 | +}; |
| 4 | + |
| 5 | +const date = new Date(); |
| 6 | +date.setHours(0, 0, 0, 0); |
| 7 | + |
| 8 | +const currentUser = { |
| 9 | + id: 'c94c0e76-fb49-4b9b-8f07-9f93ed93b4f3', |
| 10 | + name: 'John Doe', |
| 11 | +}; |
| 12 | + |
| 13 | +const supportAgent = { |
| 14 | + id: 'd16d1a4c-5c67-4e20-b70e-2991c22747c3', |
| 15 | + name: 'Support Agent', |
| 16 | + avatarUrl: '../../../../images/petersmith.png', |
| 17 | +}; |
| 18 | + |
| 19 | +const createEmptyAttachment = (name, type) => { |
| 20 | + const blob = new Blob([''], { type }); |
| 21 | + const url = URL.createObjectURL(blob); |
| 22 | + |
| 23 | + return { |
| 24 | + name, |
| 25 | + url, |
| 26 | + size: 1024 * 10, |
| 27 | + }; |
| 28 | +}; |
| 29 | + |
| 30 | +const screenshot1 = createEmptyAttachment('Screenshot1.jpg', 'image/jpeg'); |
| 31 | +const screenshot2 = createEmptyAttachment('Screenshot2.jpg', 'image/jpeg'); |
| 32 | +const screenshot3 = createEmptyAttachment('Screenshot3.jpg', 'image/jpeg'); |
| 33 | +const instructions = createEmptyAttachment('Instructions.pdf', 'application/pdf'); |
| 34 | + |
| 35 | +const messages = [ |
| 36 | + { |
| 37 | + id: new DevExpress.data.Guid(), |
| 38 | + timestamp: getTimestamp(date, -9), |
| 39 | + author: supportAgent, |
| 40 | + text: 'Hello, John!\nHow can I assist you today?', |
| 41 | + }, |
| 42 | + { |
| 43 | + id: new DevExpress.data.Guid(), |
| 44 | + timestamp: getTimestamp(date, -7), |
| 45 | + author: currentUser, |
| 46 | + text: "Hi, I'm having trouble accessing my account.\nIt says my password is incorrect. I’ve attached some screenshots for you to check.", |
| 47 | + attachments: [screenshot1, screenshot2, screenshot3], |
| 48 | + }, |
| 49 | + { |
| 50 | + id: new DevExpress.data.Guid(), |
| 51 | + timestamp: getTimestamp(date, -7), |
| 52 | + author: supportAgent, |
| 53 | + text: 'Thanks for the screenshots! I can help you with that. Please refer to the attached file for instructions to restore access.', |
| 54 | + attachments: [instructions], |
| 55 | + }, |
| 56 | +]; |
0 commit comments