From 6d16f67280b5a9f21b5556c080690d5ba008e4a2 Mon Sep 17 00:00:00 2001 From: Jared Palmer Date: Fri, 15 Nov 2024 10:14:25 -0500 Subject: [PATCH] Get rid of custom components folder --- app/(auth)/login/page.tsx | 4 ++-- app/(auth)/register/page.tsx | 4 ++-- app/(chat)/chat/[id]/page.tsx | 2 +- app/(chat)/layout.tsx | 2 +- app/(chat)/page.tsx | 2 +- app/layout.tsx | 2 +- components/{custom => }/app-sidebar.tsx | 6 +++--- components/{custom => }/auth-form.tsx | 4 ++-- components/{custom => }/block-stream-handler.tsx | 0 components/{custom => }/block.tsx | 4 ++-- components/{custom => }/chat-header.tsx | 6 +++--- components/{custom => }/chat.tsx | 6 +++--- components/{custom => }/diffview.tsx | 0 components/{custom => }/document-skeleton.tsx | 0 components/{custom => }/document.tsx | 0 components/{custom => }/editor.tsx | 0 components/{custom => }/icons.tsx | 0 components/{custom => }/markdown.tsx | 0 components/{custom => }/message-actions.tsx | 4 ++-- components/{custom => }/message.tsx | 0 components/{custom => }/model-selector.tsx | 0 components/{custom => }/multimodal-input.tsx | 4 ++-- components/{custom => }/overview.tsx | 0 components/{custom => }/preview-attachment.tsx | 0 components/{custom => }/sidebar-history.tsx | 2 +- components/{custom => }/sidebar-toggle.tsx | 2 +- components/{custom => }/sidebar-user-nav.tsx | 0 components/{custom => }/sign-out-form.tsx | 0 components/{custom => }/submit-button.tsx | 4 ++-- components/{custom => }/suggestion.tsx | 2 +- components/{custom => }/theme-provider.tsx | 0 components/{custom => }/toolbar.tsx | 2 +- components/{custom => }/use-block-stream.tsx | 0 components/{custom => }/use-scroll-to-bottom.ts | 0 components/{custom => }/version-footer.tsx | 2 +- components/{custom => }/weather.tsx | 0 lib/editor/functions.tsx | 2 +- lib/editor/suggestions.tsx | 2 +- 38 files changed, 34 insertions(+), 34 deletions(-) rename components/{custom => }/app-sidebar.tsx (91%) rename components/{custom => }/auth-form.tsx (94%) rename components/{custom => }/block-stream-handler.tsx (100%) rename components/{custom => }/block.tsx (99%) rename components/{custom => }/chat-header.tsx (92%) rename components/{custom => }/chat.tsx (94%) rename components/{custom => }/diffview.tsx (100%) rename components/{custom => }/document-skeleton.tsx (100%) rename components/{custom => }/document.tsx (100%) rename components/{custom => }/editor.tsx (100%) rename components/{custom => }/icons.tsx (100%) rename components/{custom => }/markdown.tsx (100%) rename components/{custom => }/message-actions.tsx (98%) rename components/{custom => }/message.tsx (100%) rename components/{custom => }/model-selector.tsx (100%) rename components/{custom => }/multimodal-input.tsx (99%) rename components/{custom => }/overview.tsx (100%) rename components/{custom => }/preview-attachment.tsx (100%) rename components/{custom => }/sidebar-history.tsx (99%) rename components/{custom => }/sidebar-toggle.tsx (94%) rename components/{custom => }/sidebar-user-nav.tsx (100%) rename components/{custom => }/sign-out-form.tsx (100%) rename components/{custom => }/submit-button.tsx (88%) rename components/{custom => }/suggestion.tsx (98%) rename components/{custom => }/theme-provider.tsx (100%) rename components/{custom => }/toolbar.tsx (99%) rename components/{custom => }/use-block-stream.tsx (100%) rename components/{custom => }/use-scroll-to-bottom.ts (100%) rename components/{custom => }/version-footer.tsx (98%) rename components/{custom => }/weather.tsx (100%) diff --git a/app/(auth)/login/page.tsx b/app/(auth)/login/page.tsx index 19a39b3..a8e5d8c 100644 --- a/app/(auth)/login/page.tsx +++ b/app/(auth)/login/page.tsx @@ -5,8 +5,8 @@ import { useRouter } from 'next/navigation'; import { useActionState, useEffect, useState } from 'react'; import { toast } from 'sonner'; -import { AuthForm } from '@/components/custom/auth-form'; -import { SubmitButton } from '@/components/custom/submit-button'; +import { AuthForm } from '@/components/auth-form'; +import { SubmitButton } from '@/components/submit-button'; import { login, LoginActionState } from '../actions'; diff --git a/app/(auth)/register/page.tsx b/app/(auth)/register/page.tsx index 7c6f54c..c95f49c 100644 --- a/app/(auth)/register/page.tsx +++ b/app/(auth)/register/page.tsx @@ -5,8 +5,8 @@ import { useRouter } from 'next/navigation'; import { useActionState, useEffect, useState } from 'react'; import { toast } from 'sonner'; -import { AuthForm } from '@/components/custom/auth-form'; -import { SubmitButton } from '@/components/custom/submit-button'; +import { AuthForm } from '@/components/auth-form'; +import { SubmitButton } from '@/components/submit-button'; import { register, RegisterActionState } from '../actions'; diff --git a/app/(chat)/chat/[id]/page.tsx b/app/(chat)/chat/[id]/page.tsx index a99d718..060962b 100644 --- a/app/(chat)/chat/[id]/page.tsx +++ b/app/(chat)/chat/[id]/page.tsx @@ -4,7 +4,7 @@ import { notFound } from 'next/navigation'; import { DEFAULT_MODEL_NAME, models } from '@/ai/models'; import { auth } from '@/app/(auth)/auth'; -import { Chat as PreviewChat } from '@/components/custom/chat'; +import { Chat as PreviewChat } from '@/components/chat'; import { getChatById, getMessagesByChatId } from '@/lib/db/queries'; import { convertToUIMessages } from '@/lib/utils'; diff --git a/app/(chat)/layout.tsx b/app/(chat)/layout.tsx index 46ff8aa..981aa50 100644 --- a/app/(chat)/layout.tsx +++ b/app/(chat)/layout.tsx @@ -1,6 +1,6 @@ import { cookies } from 'next/headers'; -import { AppSidebar } from '@/components/custom/app-sidebar'; +import { AppSidebar } from '@/components/app-sidebar'; import { SidebarInset, SidebarProvider } from '@/components/ui/sidebar'; import { auth } from '../(auth)/auth'; diff --git a/app/(chat)/page.tsx b/app/(chat)/page.tsx index ca43101..cad4817 100644 --- a/app/(chat)/page.tsx +++ b/app/(chat)/page.tsx @@ -1,7 +1,7 @@ import { cookies } from 'next/headers'; import { DEFAULT_MODEL_NAME, models } from '@/ai/models'; -import { Chat } from '@/components/custom/chat'; +import { Chat } from '@/components/chat'; import { generateUUID } from '@/lib/utils'; export default async function Page() { diff --git a/app/layout.tsx b/app/layout.tsx index 81b5ea0..8a29480 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,7 +1,7 @@ import { Metadata } from 'next'; import { Toaster } from 'sonner'; -import { ThemeProvider } from '@/components/custom/theme-provider'; +import { ThemeProvider } from '@/components/theme-provider'; import './globals.css'; diff --git a/components/custom/app-sidebar.tsx b/components/app-sidebar.tsx similarity index 91% rename from components/custom/app-sidebar.tsx rename to components/app-sidebar.tsx index e6b184d..b753004 100644 --- a/components/custom/app-sidebar.tsx +++ b/components/app-sidebar.tsx @@ -4,9 +4,9 @@ import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { type User } from 'next-auth'; -import { PlusIcon } from '@/components/custom/icons'; -import { SidebarHistory } from '@/components/custom/sidebar-history'; -import { SidebarUserNav } from '@/components/custom/sidebar-user-nav'; +import { PlusIcon } from '@/components/icons'; +import { SidebarHistory } from '@/components/sidebar-history'; +import { SidebarUserNav } from '@/components/sidebar-user-nav'; import { Button } from '@/components/ui/button'; import { Sidebar, diff --git a/components/custom/auth-form.tsx b/components/auth-form.tsx similarity index 94% rename from components/custom/auth-form.tsx rename to components/auth-form.tsx index a49c3ea..9584736 100644 --- a/components/custom/auth-form.tsx +++ b/components/auth-form.tsx @@ -1,7 +1,7 @@ import Form from 'next/form'; -import { Input } from '../ui/input'; -import { Label } from '../ui/label'; +import { Input } from './ui/input'; +import { Label } from './ui/label'; export function AuthForm({ action, diff --git a/components/custom/block-stream-handler.tsx b/components/block-stream-handler.tsx similarity index 100% rename from components/custom/block-stream-handler.tsx rename to components/block-stream-handler.tsx diff --git a/components/custom/block.tsx b/components/block.tsx similarity index 99% rename from components/custom/block.tsx rename to components/block.tsx index 7321121..3002b7c 100644 --- a/components/custom/block.tsx +++ b/components/block.tsx @@ -29,8 +29,8 @@ import { MultimodalInput } from './multimodal-input'; import { Toolbar } from './toolbar'; import { useScrollToBottom } from './use-scroll-to-bottom'; import { VersionFooter } from './version-footer'; -import { Button } from '../ui/button'; -import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip'; +import { Button } from './ui/button'; +import { Tooltip, TooltipContent, TooltipTrigger } from './ui/tooltip'; export interface UIBlock { title: string; documentId: string; diff --git a/components/custom/chat-header.tsx b/components/chat-header.tsx similarity index 92% rename from components/custom/chat-header.tsx rename to components/chat-header.tsx index 4448aac..c8e0070 100644 --- a/components/custom/chat-header.tsx +++ b/components/chat-header.tsx @@ -4,13 +4,13 @@ import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { useWindowSize } from 'usehooks-ts'; -import { ModelSelector } from '@/components/custom/model-selector'; -import { SidebarToggle } from '@/components/custom/sidebar-toggle'; +import { ModelSelector } from '@/components/model-selector'; +import { SidebarToggle } from '@/components/sidebar-toggle'; import { Button } from '@/components/ui/button'; import { BetterTooltip } from '@/components/ui/tooltip'; import { PlusIcon, VercelIcon } from './icons'; -import { useSidebar } from '../ui/sidebar'; +import { useSidebar } from './ui/sidebar'; export function ChatHeader({ selectedModelId }: { selectedModelId: string }) { const router = useRouter(); diff --git a/components/custom/chat.tsx b/components/chat.tsx similarity index 94% rename from components/custom/chat.tsx rename to components/chat.tsx index fa0565a..c36a02a 100644 --- a/components/custom/chat.tsx +++ b/components/chat.tsx @@ -7,9 +7,9 @@ import { useState } from 'react'; import useSWR, { useSWRConfig } from 'swr'; import { useWindowSize } from 'usehooks-ts'; -import { ChatHeader } from '@/components/custom/chat-header'; -import { PreviewMessage, ThinkingMessage } from '@/components/custom/message'; -import { useScrollToBottom } from '@/components/custom/use-scroll-to-bottom'; +import { ChatHeader } from '@/components/chat-header'; +import { PreviewMessage, ThinkingMessage } from '@/components/message'; +import { useScrollToBottom } from '@/components/use-scroll-to-bottom'; import { Vote } from '@/lib/db/schema'; import { fetcher } from '@/lib/utils'; diff --git a/components/custom/diffview.tsx b/components/diffview.tsx similarity index 100% rename from components/custom/diffview.tsx rename to components/diffview.tsx diff --git a/components/custom/document-skeleton.tsx b/components/document-skeleton.tsx similarity index 100% rename from components/custom/document-skeleton.tsx rename to components/document-skeleton.tsx diff --git a/components/custom/document.tsx b/components/document.tsx similarity index 100% rename from components/custom/document.tsx rename to components/document.tsx diff --git a/components/custom/editor.tsx b/components/editor.tsx similarity index 100% rename from components/custom/editor.tsx rename to components/editor.tsx diff --git a/components/custom/icons.tsx b/components/icons.tsx similarity index 100% rename from components/custom/icons.tsx rename to components/icons.tsx diff --git a/components/custom/markdown.tsx b/components/markdown.tsx similarity index 100% rename from components/custom/markdown.tsx rename to components/markdown.tsx diff --git a/components/custom/message-actions.tsx b/components/message-actions.tsx similarity index 98% rename from components/custom/message-actions.tsx rename to components/message-actions.tsx index d88bae8..3d0e257 100644 --- a/components/custom/message-actions.tsx +++ b/components/message-actions.tsx @@ -7,13 +7,13 @@ import { Vote } from '@/lib/db/schema'; import { getMessageIdFromAnnotations } from '@/lib/utils'; import { CopyIcon, ThumbDownIcon, ThumbUpIcon } from './icons'; -import { Button } from '../ui/button'; +import { Button } from './ui/button'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, -} from '../ui/tooltip'; +} from './ui/tooltip'; export function MessageActions({ chatId, diff --git a/components/custom/message.tsx b/components/message.tsx similarity index 100% rename from components/custom/message.tsx rename to components/message.tsx diff --git a/components/custom/model-selector.tsx b/components/model-selector.tsx similarity index 100% rename from components/custom/model-selector.tsx rename to components/model-selector.tsx diff --git a/components/custom/multimodal-input.tsx b/components/multimodal-input.tsx similarity index 99% rename from components/custom/multimodal-input.tsx rename to components/multimodal-input.tsx index 036a8c0..06ab049 100644 --- a/components/custom/multimodal-input.tsx +++ b/components/multimodal-input.tsx @@ -19,8 +19,8 @@ import { sanitizeUIMessages } from '@/lib/utils'; import { ArrowUpIcon, PaperclipIcon, StopIcon } from './icons'; import { PreviewAttachment } from './preview-attachment'; -import { Button } from '../ui/button'; -import { Textarea } from '../ui/textarea'; +import { Button } from './ui/button'; +import { Textarea } from './ui/textarea'; const suggestedActions = [ { diff --git a/components/custom/overview.tsx b/components/overview.tsx similarity index 100% rename from components/custom/overview.tsx rename to components/overview.tsx diff --git a/components/custom/preview-attachment.tsx b/components/preview-attachment.tsx similarity index 100% rename from components/custom/preview-attachment.tsx rename to components/preview-attachment.tsx diff --git a/components/custom/sidebar-history.tsx b/components/sidebar-history.tsx similarity index 99% rename from components/custom/sidebar-history.tsx rename to components/sidebar-history.tsx index 09ca8e2..fe90330 100644 --- a/components/custom/sidebar-history.tsx +++ b/components/sidebar-history.tsx @@ -8,7 +8,7 @@ import { useEffect, useState } from 'react'; import { toast } from 'sonner'; import useSWR from 'swr'; -import { MoreHorizontalIcon, TrashIcon } from '@/components/custom/icons'; +import { MoreHorizontalIcon, TrashIcon } from '@/components/icons'; import { AlertDialog, AlertDialogAction, diff --git a/components/custom/sidebar-toggle.tsx b/components/sidebar-toggle.tsx similarity index 94% rename from components/custom/sidebar-toggle.tsx rename to components/sidebar-toggle.tsx index acb29fd..332d3f7 100644 --- a/components/custom/sidebar-toggle.tsx +++ b/components/sidebar-toggle.tsx @@ -5,7 +5,7 @@ import { BetterTooltip } from '@/components/ui/tooltip'; import { cn } from '@/lib/utils'; import { SidebarLeftIcon } from './icons'; -import { Button } from '../ui/button'; +import { Button } from './ui/button'; export function SidebarToggle({ className, diff --git a/components/custom/sidebar-user-nav.tsx b/components/sidebar-user-nav.tsx similarity index 100% rename from components/custom/sidebar-user-nav.tsx rename to components/sidebar-user-nav.tsx diff --git a/components/custom/sign-out-form.tsx b/components/sign-out-form.tsx similarity index 100% rename from components/custom/sign-out-form.tsx rename to components/sign-out-form.tsx diff --git a/components/custom/submit-button.tsx b/components/submit-button.tsx similarity index 88% rename from components/custom/submit-button.tsx rename to components/submit-button.tsx index 34e4f17..526c32e 100644 --- a/components/custom/submit-button.tsx +++ b/components/submit-button.tsx @@ -2,9 +2,9 @@ import { useFormStatus } from 'react-dom'; -import { LoaderIcon } from '@/components/custom/icons'; +import { LoaderIcon } from '@/components/icons'; -import { Button } from '../ui/button'; +import { Button } from './ui/button'; export function SubmitButton({ children, diff --git a/components/custom/suggestion.tsx b/components/suggestion.tsx similarity index 98% rename from components/custom/suggestion.tsx rename to components/suggestion.tsx index 02d2258..b0a9dfe 100644 --- a/components/custom/suggestion.tsx +++ b/components/suggestion.tsx @@ -7,7 +7,7 @@ import { useWindowSize } from 'usehooks-ts'; import { UISuggestion } from '@/lib/editor/suggestions'; import { CrossIcon, MessageIcon } from './icons'; -import { Button } from '../ui/button'; +import { Button } from './ui/button'; export const Suggestion = ({ suggestion, diff --git a/components/custom/theme-provider.tsx b/components/theme-provider.tsx similarity index 100% rename from components/custom/theme-provider.tsx rename to components/theme-provider.tsx diff --git a/components/custom/toolbar.tsx b/components/toolbar.tsx similarity index 99% rename from components/custom/toolbar.tsx rename to components/toolbar.tsx index ec052e1..559a289 100644 --- a/components/custom/toolbar.tsx +++ b/components/toolbar.tsx @@ -26,7 +26,7 @@ import { StopIcon, SummarizeIcon, } from './icons'; -import { Button } from '../ui/button'; +import { Button } from './ui/button'; type ToolProps = { type: 'final-polish' | 'request-suggestions' | 'adjust-reading-level'; diff --git a/components/custom/use-block-stream.tsx b/components/use-block-stream.tsx similarity index 100% rename from components/custom/use-block-stream.tsx rename to components/use-block-stream.tsx diff --git a/components/custom/use-scroll-to-bottom.ts b/components/use-scroll-to-bottom.ts similarity index 100% rename from components/custom/use-scroll-to-bottom.ts rename to components/use-scroll-to-bottom.ts diff --git a/components/custom/version-footer.tsx b/components/version-footer.tsx similarity index 98% rename from components/custom/version-footer.tsx rename to components/version-footer.tsx index c257949..f92d642 100644 --- a/components/custom/version-footer.tsx +++ b/components/version-footer.tsx @@ -11,7 +11,7 @@ import { getDocumentTimestampByIndex } from '@/lib/utils'; import { UIBlock } from './block'; import { LoaderIcon } from './icons'; -import { Button } from '../ui/button'; +import { Button } from './ui/button'; interface VersionFooterProps { block: UIBlock; diff --git a/components/custom/weather.tsx b/components/weather.tsx similarity index 100% rename from components/custom/weather.tsx rename to components/weather.tsx diff --git a/lib/editor/functions.tsx b/lib/editor/functions.tsx index eb58ac5..6d0d394 100644 --- a/lib/editor/functions.tsx +++ b/lib/editor/functions.tsx @@ -5,7 +5,7 @@ import { DOMParser, Node } from 'prosemirror-model'; import { Decoration, DecorationSet, EditorView } from 'prosemirror-view'; import { renderToString } from 'react-dom/server'; -import { Markdown } from '@/components/custom/markdown'; +import { Markdown } from '@/components/markdown'; import { documentSchema } from './config'; import { createSuggestionWidget, UISuggestion } from './suggestions'; diff --git a/lib/editor/suggestions.tsx b/lib/editor/suggestions.tsx index e9bd850..84d69e6 100644 --- a/lib/editor/suggestions.tsx +++ b/lib/editor/suggestions.tsx @@ -3,7 +3,7 @@ import { PluginKey, Plugin } from 'prosemirror-state'; import { Decoration, DecorationSet, EditorView } from 'prosemirror-view'; import { createRoot } from 'react-dom/client'; -import { Suggestion as PreviewSuggestion } from '@/components/custom/suggestion'; +import { Suggestion as PreviewSuggestion } from '@/components/suggestion'; import { Suggestion } from '@/lib/db/schema'; export interface UISuggestion extends Suggestion {