diff --git a/src/server/ui/.prettierrc.js b/src/server/ui/.prettierrc.js new file mode 100644 index 0000000..e16d88b --- /dev/null +++ b/src/server/ui/.prettierrc.js @@ -0,0 +1,11 @@ +module.exports = { + singleQuote: true, + jsxSingleQuote: true, + semi: false, + trailingComma: 'es5', + tabWidth: 2, + useTabs: false, + quoteProps: 'consistent', + bracketSpacing: true, + printWidth: 120, +} diff --git a/src/server/ui/package.json b/src/server/ui/package.json index 429d960..7c1e661 100644 --- a/src/server/ui/package.json +++ b/src/server/ui/package.json @@ -26,6 +26,7 @@ "@types/react-dom": "latest", "eslint": "latest", "eslint-config-next": "latest", + "prettier": "^3.2.5", "typescript": "latest" } } diff --git a/src/server/ui/src/app/layout.tsx b/src/server/ui/src/app/layout.tsx index ed39576..d9cd09e 100644 --- a/src/server/ui/src/app/layout.tsx +++ b/src/server/ui/src/app/layout.tsx @@ -1,13 +1,13 @@ -import * as React from 'react'; -import { AppRouterCacheProvider } from '@mui/material-nextjs/v14-appRouter'; -import { ThemeProvider } from '@mui/material/styles'; -import CssBaseline from '@mui/material/CssBaseline'; -import theme from '@/theme'; -import Header from "@/components/Header"; +import * as React from 'react' +import { AppRouterCacheProvider } from '@mui/material-nextjs/v14-appRouter' +import { ThemeProvider } from '@mui/material/styles' +import CssBaseline from '@mui/material/CssBaseline' +import theme from '@/theme' +import Header from '@/components/Header' export default function RootLayout(props: { children: React.ReactNode }) { return ( - + @@ -19,5 +19,5 @@ export default function RootLayout(props: { children: React.ReactNode }) { - ); + ) } diff --git a/src/server/ui/src/app/page.tsx b/src/server/ui/src/app/page.tsx index 036a572..f30c90c 100644 --- a/src/server/ui/src/app/page.tsx +++ b/src/server/ui/src/app/page.tsx @@ -1,15 +1,15 @@ -import * as React from 'react'; -import Container from '@mui/material/Container'; -import ChatHistory, {MessageItem} from "@/components/ChatHistory"; +import * as React from 'react' +import Container from '@mui/material/Container' +import ChatHistory, { MessageItem } from '@/components/ChatHistory' export default function Home() { - const messages: MessageItem[] = [ - {message: 'Hello', timestamp: 123, role: 'user'}, - {message: 'Hello from bot', timestamp: 123, role: 'assistant'} - ]; + const messages: MessageItem[] = [ + { message: 'Hello', timestamp: 123, role: 'user' }, + { message: 'Hello from bot', timestamp: 123, role: 'assistant' }, + ] return ( - - + + - ); + ) } diff --git a/src/server/ui/src/components/ChatHistory.tsx b/src/server/ui/src/components/ChatHistory.tsx index 9bf9ec2..efaaa4d 100644 --- a/src/server/ui/src/components/ChatHistory.tsx +++ b/src/server/ui/src/components/ChatHistory.tsx @@ -1,23 +1,26 @@ -import Message from "@/components/Message"; +import Message from '@/components/Message' export interface MessageItem { - message: string - timestamp: number - role: 'user' | 'assistant' + message: string + timestamp: number + role: 'user' | 'assistant' } export interface ChatHistoryProps { - messages: MessageItem[] + messages: MessageItem[] } -export default function ChatHistory({messages}: ChatHistoryProps) { - return ( -
- {messages.map((message, index) => ( - - ))} -
- ) +export default function ChatHistory({ messages }: ChatHistoryProps) { + return ( +
+ {messages.map((message, index) => ( + + ))} +
+ ) } - diff --git a/src/server/ui/src/components/Header.tsx b/src/server/ui/src/components/Header.tsx index 05c1e86..1c7c9f5 100644 --- a/src/server/ui/src/components/Header.tsx +++ b/src/server/ui/src/components/Header.tsx @@ -1,31 +1,24 @@ -import * as React from 'react'; -import AppBar from '@mui/material/AppBar'; -import Box from '@mui/material/Box'; -import Toolbar from '@mui/material/Toolbar'; -import Typography from '@mui/material/Typography'; -import IconButton from '@mui/material/IconButton'; -import MenuIcon from '@mui/icons-material/Menu'; +import * as React from 'react' +import AppBar from '@mui/material/AppBar' +import Box from '@mui/material/Box' +import Toolbar from '@mui/material/Toolbar' +import Typography from '@mui/material/Typography' +import IconButton from '@mui/material/IconButton' +import MenuIcon from '@mui/icons-material/Menu' export default function Header() { - return ( - - - - - - - - LX01 - - - - - ); + return ( + + + + + + + + LX01 + + + + + ) } - diff --git a/src/server/ui/src/components/Message.tsx b/src/server/ui/src/components/Message.tsx index 7691017..5e8940b 100644 --- a/src/server/ui/src/components/Message.tsx +++ b/src/server/ui/src/components/Message.tsx @@ -1,27 +1,28 @@ -import {ReactNode} from "react"; +import { ReactNode } from 'react' export interface MessageProps { - message: string - avatar: ReactNode - role: string + message: string + avatar: ReactNode + role: string } export default function Message(props: MessageProps) { - return ( -
- {props.avatar} -
{props.message}
-
- ) + return ( +
+ {props.avatar} +
+ {props.message} +
+
+ ) } - diff --git a/src/server/ui/src/components/ProTip.tsx b/src/server/ui/src/components/ProTip.tsx index 217b5bf..d323a12 100644 --- a/src/server/ui/src/components/ProTip.tsx +++ b/src/server/ui/src/components/ProTip.tsx @@ -1,14 +1,14 @@ -import * as React from 'react'; -import Link from '@mui/material/Link'; -import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon'; -import Typography from '@mui/material/Typography'; +import * as React from 'react' +import Link from '@mui/material/Link' +import SvgIcon, { SvgIconProps } from '@mui/material/SvgIcon' +import Typography from '@mui/material/Typography' function LightBulbIcon(props: SvgIconProps) { return ( - + - ); + ) } export default function ProTip() { @@ -16,8 +16,8 @@ export default function ProTip() { {'Pro tip: See more '} - templates + templates {' in the Material UI documentation.'} - ); + ) } diff --git a/src/server/ui/src/theme.ts b/src/server/ui/src/theme.ts index b105b58..5f09bc5 100644 --- a/src/server/ui/src/theme.ts +++ b/src/server/ui/src/theme.ts @@ -1,12 +1,12 @@ -'use client'; -import { Roboto } from 'next/font/google'; -import { createTheme } from '@mui/material/styles'; +'use client' +import { Roboto } from 'next/font/google' +import { createTheme } from '@mui/material/styles' const roboto = Roboto({ weight: ['300', '400', '500', '700'], subsets: ['latin'], display: 'swap', -}); +}) const theme = createTheme({ palette: { @@ -26,6 +26,6 @@ const theme = createTheme({ }, }, }, -}); +}) -export default theme; +export default theme diff --git a/src/server/ui/yarn.lock b/src/server/ui/yarn.lock index 49553bc..9343b58 100644 --- a/src/server/ui/yarn.lock +++ b/src/server/ui/yarn.lock @@ -2165,6 +2165,11 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== +prettier@^3.2.5: + version "3.2.5" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.5.tgz#e52bc3090586e824964a8813b09aba6233b28368" + integrity sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A== + prop-types@^15.6.2, prop-types@^15.8.1: version "15.8.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" @@ -2397,6 +2402,7 @@ streamsearch@^1.1.0: integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg== "string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0: + name string-width-cjs version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==