Skip to content

Commit

Permalink
style: move save button to be next to stack trace
Browse files Browse the repository at this point in the history
Signed-off-by: tylerslaton <[email protected]>
  • Loading branch information
tylerslaton committed Sep 12, 2024
1 parent 9947152 commit c1a13eb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 5 additions & 1 deletion components/chat/messages/calls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
Button,
Tooltip,
} from '@nextui-org/react';
import SaveFile from '@/components/saveFile';

const Calls = ({ calls }: { calls: Record<string, CallFrame> }) => {
const [showModal, setShowModal] = useState(false);
Expand Down Expand Up @@ -41,7 +42,10 @@ const Calls = ({ calls }: { calls: Record<string, CallFrame> }) => {
<ModalContent>
<ModalHeader className="flex justify-between">
<div>
<h1 className="text-2xl my-4">Stack Trace</h1>
<div className="my-2">
<h1 className="text-2xl inline mr-2">Stack Trace</h1>
<SaveFile content={calls}/>
</div>
<h2 className="text-base text-zinc-500">
Below you can see what this call is doing or has done.
</h2>
Expand Down
2 changes: 0 additions & 2 deletions components/chat/messages/calls/stackTrace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Button, Tooltip } from '@nextui-org/react';
import type { CallFrame } from '@gptscript-ai/gptscript';
import { GoArrowDown, GoArrowUp } from 'react-icons/go';
import { AiOutlineLoading3Quarters } from 'react-icons/ai';
import SaveFile from '@/components/saveFile';

const StackTrace = ({ calls }: { calls: Record<string, CallFrame> | null }) => {
if (!calls) return null;
Expand Down Expand Up @@ -132,7 +131,6 @@ const StackTrace = ({ calls }: { calls: Record<string, CallFrame> | null }) => {
{allOpen ? <GoArrowUp /> : <GoArrowDown />}
</Button>
</Tooltip>
<SaveFile content={calls} className="absolute bottom-9 right-8" />
{calls ? <RenderLogs /> : <EmptyLogs />}
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion components/saveFile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ const SaveFile: React.FC<Props> = ({ content, className }) => {
return (
<Tooltip content={'Download Stack Trace'} closeDelay={0}>
<Button
size="sm"
onPress={handleSave}
className={className}
isIconOnly
radius="full"
color="primary"
startContent={<GoDownload />}
/>
</Tooltip>
Expand Down

0 comments on commit c1a13eb

Please sign in to comment.