Skip to content

Commit

Permalink
chore(frontend): cleanup codes
Browse files Browse the repository at this point in the history
  • Loading branch information
634750802 committed Aug 9, 2024
1 parent 3003535 commit 494720b
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 78 deletions.
9 changes: 1 addition & 8 deletions frontend/app/src/components/chat/chat-hooks.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { type Chat, type ChatMessage, ChatMessageRole, type PostChatParams } from '@/api/chats';
import { type Chat, type ChatMessage, ChatMessageRole } from '@/api/chats';
import { isBootstrapStatusPassed } from '@/api/system';
import { ChatController, ChatMessageController, type OngoingState } from '@/components/chat/chat-controller';
import { useBootstrapStatus } from '@/components/system/BootstrapStatusProvider';
import { useLatestRef } from '@/components/use-latest-ref';
import { createContext, type ReactNode, useContext, useEffect, useState } from 'react';
import { util } from 'zod';
import Omit = util.Omit;

export interface ChatsProviderValues {
chats: Map<string, ChatController>;
Expand All @@ -16,12 +15,6 @@ export interface ChatsProviderValues {
destroyChat (id: string): void;
}

export interface ChatProviderValues {
controller: ChatController | null;

post (postParams: Omit<PostChatParams, 'chat_id'>): Promise<void>;
}

const ChatsContext = createContext<ChatsProviderValues>({
chats: new Map(),
disabled: true,
Expand Down
9 changes: 0 additions & 9 deletions frontend/app/src/components/chat/use-message-feedback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@ export interface UseMessageFeedbackReturns {
// deleteFeedback (): Promise<void>;
}

export type ContentSource = {
query: string
markdownSources: {
kgRelationshipUrls: string[]
restUrls: string[]
}
kgSources: Record<string, any>
}

export function useMessageFeedback (messageId: number | undefined, enabled: boolean): UseMessageFeedbackReturns {
const [feedback, setFeedback] = useState<FeedbackParams>();
const isLoading = false;
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/src/components/copy-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button, type ButtonProps } from '@/components/ui/button';
import { cn } from '@/lib/utils';
import copy from 'copy-to-clipboard';
import { ClipboardCheckIcon, ClipboardIcon } from 'lucide-react';
import { useEffect, useLayoutEffect, useState } from 'react';
import { useLayoutEffect, useState } from 'react';

export interface CopyButtonProps extends Omit<ButtonProps, 'children' | 'type'> {
text: string;
Expand Down
7 changes: 1 addition & 6 deletions frontend/app/src/components/html-viewer.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
'use client'
'use client';

import Highlight from 'highlight.js/lib/core';
import html from 'highlight.js/lib/languages/xml';
import { useEffect, useState } from 'react';
import './code-theme.scss';

export interface HtmlViewerProps {
content: string;
mime: string;
}

Highlight.registerLanguage('html', html);

export function HtmlViewer ({ value: propValue }: { value: string }) {
Expand Down
20 changes: 0 additions & 20 deletions frontend/app/src/components/use-cookie.tsx

This file was deleted.

34 changes: 0 additions & 34 deletions frontend/app/src/components/zod-form.tsx

This file was deleted.

0 comments on commit 494720b

Please sign in to comment.