Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add combobox for export options #292

Merged
merged 7 commits into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
resolve merge conflicts
  • Loading branch information
Jshen123 committed Apr 21, 2023
commit 4a7b03248ea50cbd49e449d3201a17f95fc5b79b
21 changes: 18 additions & 3 deletions src/components/ChatWindow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import WindowButton from "./WindowButton";
import PDFButton from "./pdf/PDFButton";
import FadeIn from "./motions/FadeIn";
import Combobox from "./Combobox";
import type { Message } from "../types/agentTypes";
import clsx from "clsx";

interface ChatWindowProps extends HeaderProps {
children?: ReactNode;
Expand Down Expand Up @@ -184,6 +186,17 @@ const MacWindowHeader = (props: HeaderProps) => {
<PDFButton key="PDF" name="Save as PDF" messages={props.messages} />,
];

if (props.onSave) {
exportOptions.push(
<WindowButton
delay={0.25}
onClick={() => props.onSave?.("db")}
icon={<FaSave size={12} />}
name={"Save"}
/>
);
}

return (
<div className="flex items-center gap-1 overflow-hidden rounded-t-3xl p-3">
<PopIn delay={0.4}>
Expand All @@ -195,10 +208,12 @@ const MacWindowHeader = (props: HeaderProps) => {
<PopIn delay={0.6}>
<div className="h-3 w-3 rounded-full bg-green-500" />
</PopIn>
<div className="invisible flex flex-grow font-mono text-sm font-bold text-gray-600 sm:ml-2 md:visible">
<Expand
delay={1}
className="invisible flex flex-grow font-mono text-sm font-bold text-gray-600 sm:ml-2 md:visible"
>
{props.title}
</div>

</Expand>
<Combobox
value="Export"
onChange={() => null}
Expand Down
1 change: 0 additions & 1 deletion src/components/pdf/PDFButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import WindowButton from "../WindowButton";
import { FaFilePdf, FaRegFilePdf, FaSave } from "react-icons/fa";
import { pdf } from "@react-pdf/renderer";
import React, { memo } from "react";
import type { Message } from "../ChatWindow";
import MyDocument from "./MyDocument";
import type { Message } from "../../types/agentTypes";

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.