import React, { useContext, useState } from "react"; import chatIcon from "../assets/chat.png"; import botIcon from "../assets/bot.png"; import teamIcon from "../assets/group.png"; import timeLine from "../assets/process.png"; import todo from "../assets/calendar.png"; import { Tooltip, SideSheet } from "@douyinfe/semi-ui"; import { UndoRedoContext } from "../pages/editor"; // import { // IllustrationNoContent, // IllustrationNoContentDark, // } from "@douyinfe/semi-illustrations"; export default function Sidebar() { const SidesheetType = { NONE: 0, CHAT: 1, TEAM: 2, TODO: 3, TIMELINE: 4, BOT: 5, }; const [sidesheet, setSidesheet] = useState(SidesheetType.NONE); const { undoStack } = useContext(UndoRedoContext); const getTitle = (type) => { switch (type) { case SidesheetType.TIMELINE: return (
chat icon
Timeline
); case SidesheetType.CHAT: return (
chat icon
Chat
); case SidesheetType.TEAM: return (
chat icon
Your team
); default: break; } }; const getContent = (type) => { switch (type) { case SidesheetType.TIMELINE: return getTimeline(); default: break; } }; return ( <>
setSidesheet(SidesheetType.NONE)} width={340} title={getTitle(sidesheet)} style={{ paddingBottom: "16px" }} > {getContent(sidesheet)} ); function getTimeline() { if (undoStack.length > 0) { return (

{[...undoStack].reverse().map((e) => ( <>
{e.message}

))}
); } else { return (
You havent added anything to your diagram yet.
// } // darkModeImage={ // // } // title="No activity" // description="You have not added anything to your diagram yet." // /> ); } } }