13 | {/* show the last couple history items blurred on top of each other */}
14 | {history
15 | .reverse()
16 | .slice(1)
17 | .slice(history.length - 3)
18 | .map((item, index) => {
19 | if ("images" in item) {
20 | return (
21 |
30 | {item.images.map((artifact) => (
31 |

37 | ))}
38 |
39 | );
40 | } else {
41 | return (
42 |
51 |
52 |
53 |
54 | {item.user}
55 |
56 |
57 | {item.text}
58 |
59 |
60 |
61 | );
62 | }
63 | })}
64 |
65 | );
66 | }
67 |
68 | export type HistoryState = {
69 | history: History.HistoryItem[];
70 | setHistory: (history: History.HistoryItem[]) => void;
71 | addItem: (item: History.HistoryItem) => void;
72 | addItems: (items: History.HistoryItem[]) => void;
73 | };
74 |
75 | export namespace History {
76 | export const use = create