Start on new sidebar (#456)

Co-authored-by: shadcn <m@shadcn.com>
This commit is contained in:
Jared Palmer 2024-10-24 16:35:51 -04:00 committed by GitHub
parent 7faa5f1c9f
commit a68eb2a011
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 2350 additions and 800 deletions

View file

@ -1,6 +1,6 @@
import { Attachment } from "ai";
import { Attachment } from 'ai';
import { LoaderIcon } from "./icons";
import { LoaderIcon } from './icons';
export const PreviewAttachment = ({
attachment,
@ -12,18 +12,18 @@ export const PreviewAttachment = ({
const { name, url, contentType } = attachment;
return (
(<div className="flex flex-col gap-2 max-w-16">
<div className="h-20 w-16 bg-muted rounded-md relative flex flex-col items-center justify-center">
<div className="flex flex-col gap-2 max-w-16">
<div className="w-20 aspect-video bg-muted rounded-md relative flex flex-col items-center justify-center">
{contentType ? (
contentType.startsWith("image") ? (
contentType.startsWith('image') ? (
// NOTE: it is recommended to use next/image for images
// eslint-disable-next-line @next/next/no-img-element
(<img
<img
key={url}
src={url}
alt={name ?? "An image attachment"}
alt={name ?? 'An image attachment'}
className="rounded-md size-full object-cover"
/>)
/>
) : (
<div className=""></div>
)
@ -38,6 +38,6 @@ export const PreviewAttachment = ({
)}
</div>
<div className="text-xs text-zinc-500 max-w-16 truncate">{name}</div>
</div>)
</div>
);
};