Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
iipanda committed Oct 25, 2024
1 parent 30a92a0 commit 371d4c8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 20 deletions.
24 changes: 22 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,30 @@ Visit [the documentation](https://shadcn-chatbot-kit.vercel.app/docs/components/

## 🚀 Quick Start

<!-- TODO: example here -->
**Note:** This example uses the Vercel AI SDK. Follow the [official Getting Started guide](https://sdk.vercel.ai/docs/getting-started/nextjs-app-router#create-your-application), before using it.

```tsx

"use client"

import { useChat } from "ai/react"

import { Chat } from "@/components/ui/chat"

export function ChatDemo() {
const { messages, input, handleInputChange, handleSubmit, isLoading, stop } =
useChat()

return (
<Chat
messages={messages}
input={input}
handleInputChange={handleInputChange}
handleSubmit={handleSubmit}
isGenerating={isLoading}
stop={stop}
/>
)
}
```

## 🎨 Customization
Expand Down
16 changes: 1 addition & 15 deletions apps/www/registry/default/ui/markdown-renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,8 @@ const COMPONENTS = {
strong: withClass("strong", "font-semibold"),
a: withClass("a", "text-primary underline underline-offset-2"),
blockquote: withClass("blockquote", "border-l-2 border-primary pl-4"),
// TODO fix anys
code: ({ children, className, node, ...rest }: any) => {
console.log("code renderer", children)
const match = /language-(\w+)/.exec(className || "")
return match ? (
// TODO: syntax highlighting
<>
<p>{match[1]}</p>
<code
className="font-mono [:not(pre)>&]:rounded-md [:not(pre)>&]:bg-background/50 [:not(pre)>&]:px-1 [:not(pre)>&]:py-0.5"
{...rest}
>
{children}
</code>
</>
) : (
return (
<code
className="font-mono [:not(pre)>&]:rounded-md [:not(pre)>&]:bg-background/50 [:not(pre)>&]:px-1 [:not(pre)>&]:py-0.5"
{...rest}
Expand Down
3 changes: 0 additions & 3 deletions apps/www/registry/default/ui/message-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ export function MessageInput({
showFileList && "pb-16",
className
)}
// TODO: better way to do this
{...(props.allowAttachments
? omit(props, ["allowAttachments", "files", "setFiles"])
: omit(props, ["allowAttachments"]))}
Expand Down Expand Up @@ -325,8 +324,6 @@ function showFileUploadDialog() {

input.type = "file"
input.multiple = true
// TODO: accept value
// file.type.startsWith("image/") || file.type.startsWith("text/")
input.accept = "*/*"
input.click()

Expand Down

0 comments on commit 371d4c8

Please sign in to comment.