diff --git a/components/Sidebar/Import.tsx b/components/Sidebar/Import.tsx index 199b748..caa0bfe 100644 --- a/components/Sidebar/Import.tsx +++ b/components/Sidebar/Import.tsx @@ -2,6 +2,7 @@ import { ChatFolder, Conversation } from "@/types"; import { cleanConversationHistory } from "@/utils/app/clean"; import { IconFileImport } from "@tabler/icons-react"; import { FC } from "react"; +import { SidebarButton } from "./SidebarButton"; interface Props { onImport: (data: { conversations: Conversation[]; folders: ChatFolder[] }) => void; @@ -9,9 +10,11 @@ interface Props { export const Import: FC = ({ onImport }) => { return ( -
+ <> { @@ -31,10 +34,17 @@ export const Import: FC = ({ onImport }) => { reader.readAsText(file); }} /> -
- -
Import conversations
-
-
+ + } + onClick={() => { + const importFile = document.querySelector("#import-file") as HTMLInputElement; + if (importFile) { + importFile.click(); + } + }} + /> + ); }; diff --git a/components/Sidebar/SidebarButton.tsx b/components/Sidebar/SidebarButton.tsx index 1ba237f..8b7be3e 100644 --- a/components/Sidebar/SidebarButton.tsx +++ b/components/Sidebar/SidebarButton.tsx @@ -8,12 +8,12 @@ interface Props { export const SidebarButton: FC = ({ text, icon, onClick }) => { return ( -
{icon}
{text}
-
+ ); };