Skip to content

Commit

Permalink
Merge pull request #1 from Eyevinn/chat_agent_gui_basic
Browse files Browse the repository at this point in the history
feat: implement ai agent basic gui
  • Loading branch information
ernestocarocca authored Dec 3, 2024
2 parents 651f0c1 + 0459ac2 commit 35119b9
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 6 deletions.
2 changes: 1 addition & 1 deletion nodemon.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"watch": ["src"],
"ext": "ts",
"exec": "node --inspect -r ts-node/register ./src/server.ts"
}
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"prepare": "husky install",
"lint": "eslint .",
"pretty": "prettier --check --ignore-unknown .",
"pretty:fix": "prettier --write . && prettier --write readme-typescript-nodejs.md",
"typecheck": "tsc --noEmit -p tsconfig.json",
"dev": "nodemon",
"dev:app": "NODE_OPTIONS='--inspect' NEXT_PUBLIC_API_URL=http://localhost:8000/api/v1 next dev",
Expand Down
4 changes: 2 additions & 2 deletions readme-typescript-nodejs.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# typescript-nodejs
# typescript-nodejs

Requirements: node.js >= 18.15.0 ( LTS )

Expand All @@ -14,4 +14,4 @@ Template for TypeScript nodejs projects. It includes:

1. Update package.json with your project details
2. Install dependencies with `npm install`
3. Start coding!
3. Start coding!
36 changes: 33 additions & 3 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,39 @@
import ApiUrl from '@/components/ApiUrl';
'use client';

import { Card, CardHeader, CardBody } from '@nextui-org/card';
import { Button, Spacer } from '@nextui-org/react';
import { IconArrowUp, IconTrash } from '@tabler/icons-react';
import { TextArea } from '@/components/Textearea';

export default function Page() {
return (
<div className="flex flex-col h-screen overflow-hidden">
<ApiUrl />
<div className=" w-screen h-screen glassmorphism">
<Card className="w-full h-full fixed py-2 bg-transparent ">
<div className=" flex">
<Button className=" bg-transparent " isIconOnly>
<IconTrash color="gray" size={24} />
</Button>
<CardHeader className="text-center fonst-bold text-white">
Chat with AI
</CardHeader>
</div>
<Spacer y={10} />
<CardBody className="flex-grow text-white font-bold"></CardBody>
<div className="flex bg-gray-200 flex-grow items-center p-2 overflow-scroll">
<TextArea
type="text"
placeholder="Type your question..."
minRows={1}
maxRows={4}
/>
<Button
isIconOnly
className="bg-secondary py-1 mr-0 mb-2 ml-2 h-[30px] w-[32px] rounded-full"
>
<IconArrowUp size={30} stroke={3} />
</Button>
</div>
</Card>
</div>
);
}
30 changes: 30 additions & 0 deletions src/components/Textearea.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { extendVariants } from '@nextui-org/react';

const TextArea = ({ ...props }) => {
return (
<ExtendedTextarea
className={'mb-2'}
radius="xs"
labelPlacement="outside"
{...props}
/>
);
};
const ExtendedTextarea = extendVariants(TextArea, {
variants: {
radius: {
xs: {
inputWrapper: ['bg-content6', 'rounded', 'shadow-none']
}
},
textSize: {
base: {
input: 'text-base'
},
large: {
input: 'text-2xl'
}
}
}
});
export { TextArea };

0 comments on commit 35119b9

Please sign in to comment.