Clear conversations (#53)

* Add button "Clear Conversations"

* custom btn

---------

Co-authored-by: Xiangxuan Liu <xiangxuan.liu@rightcapital.com>
This commit is contained in:
Mckay Wrigley
2023-03-21 16:38:04 -06:00
committed by GitHub
parent cb0fb447a7
commit b7803cf4ba
4 changed files with 79 additions and 9 deletions
+5 -1
View File
@@ -1,5 +1,6 @@
import { IconMoon, IconSun } from "@tabler/icons-react";
import { FC } from "react";
import { ClearConversations } from "./ClearConversations";
import { Key } from "./Key";
import { SidebarButton } from "./SidebarButton";
@@ -8,11 +9,14 @@ interface Props {
apiKey: string;
onToggleLightMode: (mode: "light" | "dark") => void;
onApiKeyChange: (apiKey: string) => void;
onClearConversations: () => void;
}
export const SidebarSettings: FC<Props> = ({ lightMode, apiKey, onToggleLightMode, onApiKeyChange }) => {
export const SidebarSettings: FC<Props> = ({ lightMode, apiKey, onToggleLightMode, onApiKeyChange, onClearConversations }) => {
return (
<div className="flex flex-col items-center border-t border-neutral-500 px-2 py-4 text-sm space-y-2">
<ClearConversations onClearConversations={onClearConversations} />
<SidebarButton
text={lightMode === "light" ? "Dark mode" : "Light mode"}
icon={lightMode === "light" ? <IconMoon size={16} /> : <IconSun size={16} />}