Skip to content

Commit

Permalink
feat: icon tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
grutt committed Feb 13, 2024
1 parent 29eb8c4 commit 1cf0165
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
1 change: 1 addition & 0 deletions frontend/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.48.2",
"react-icons": "^5.0.1",
"react-router-dom": "^6.20.0",
"react-syntax-highlighter": "^15.5.0",
"reactflow": "^11.10.3",
Expand Down
11 changes: 11 additions & 0 deletions frontend/app/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { CodeEditor } from '@/components/ui/code-editor';
import { JsonForm } from '@/components/ui/json-form';
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
import { VscNote, VscJson } from 'react-icons/vsc';

export interface StepRunOutputProps {
input: string;
Expand All @@ -17,9 +18,13 @@ export const StepRunInputs: React.FC<StepRunOutputProps> = ({
}) => {
return (
<Tabs defaultValue="output" className="w-full">
<TabsList className="grid w-full grid-cols-2">
<TabsTrigger value="form">Form</TabsTrigger>
<TabsTrigger value="code">Code</TabsTrigger>
<TabsList className="grid w-1/3 grid-cols-2">
<TabsTrigger value="form" aria-label="Form Editor">
<VscNote />
</TabsTrigger>
<TabsTrigger value="json" aria-label="JSON Editor">
<VscJson />
</TabsTrigger>
</TabsList>
<TabsContent value="form">
<JsonForm
Expand All @@ -29,7 +34,7 @@ export const StepRunInputs: React.FC<StepRunOutputProps> = ({
disabled={disabled}
/>
</TabsContent>
<TabsContent value="code">
<TabsContent value="json">
<CodeEditor
language="json"
className="my-4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { cn } from '@/lib/utils';
import { useOutletContext } from 'react-router-dom';
import { TenantContextType } from '@/lib/outlet';
import { PlayIcon } from '@radix-ui/react-icons';
import { JsonForm } from '@/components/ui/json-form';
import { StepRunOutput } from './step-run-output';
import { StepRunInputs } from './step-run-inputs';

Expand Down

0 comments on commit 1cf0165

Please sign in to comment.