mirror of
https://github.com/sqlchat/sqlchat.git
synced 2025-09-28 18:43:53 +08:00
chore: add prettier and format code files
This commit is contained in:
@ -1,18 +1,9 @@
|
||||
import {
|
||||
useConversationStore,
|
||||
useConnectionStore,
|
||||
useMessageStore,
|
||||
} from "@/store";
|
||||
import { CreatorRole } from "@/types";
|
||||
import { generateUUID } from "@/utils";
|
||||
import { useConversationStore, useConnectionStore, useMessageStore } from "@/store";
|
||||
import useDarkMode from "@/hooks/useDarkmode";
|
||||
import Icon from "./Icon";
|
||||
|
||||
// examples are used to show some examples to the user.
|
||||
const examples = [
|
||||
"Give me an example schema about employee",
|
||||
"How to create a view in MySQL?",
|
||||
];
|
||||
const examples = ["Give me an example schema about employee", "How to create a view in MySQL?"];
|
||||
|
||||
interface Props {
|
||||
className?: string;
|
||||
@ -27,38 +18,22 @@ const EmptyView = (props: Props) => {
|
||||
const isDarkMode = useDarkMode();
|
||||
|
||||
const handleExampleClick = async (content: string) => {
|
||||
let conversation = conversationStore.getConversationById(
|
||||
conversationStore.currentConversationId
|
||||
);
|
||||
let conversation = conversationStore.getConversationById(conversationStore.currentConversationId);
|
||||
if (!conversation) {
|
||||
const currentConnectionCtx = connectionStore.currentConnectionCtx;
|
||||
if (!currentConnectionCtx) {
|
||||
conversation = conversationStore.createConversation();
|
||||
} else {
|
||||
conversation = conversationStore.createConversation(
|
||||
currentConnectionCtx.connection.id,
|
||||
currentConnectionCtx.database?.name
|
||||
);
|
||||
conversation = conversationStore.createConversation(currentConnectionCtx.connection.id, currentConnectionCtx.database?.name);
|
||||
}
|
||||
}
|
||||
await sendMessage(content);
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`${
|
||||
className || ""
|
||||
} w-full h-full flex flex-col justify-start items-center`}
|
||||
>
|
||||
<div className={`${className || ""} w-full h-full flex flex-col justify-start items-center`}>
|
||||
<div className="w-96 max-w-full font-medium leading-loose mb-8">
|
||||
<img
|
||||
src={
|
||||
isDarkMode
|
||||
? "/chat-logo-and-text-dark-mode.webp"
|
||||
: "/chat-logo-and-text.webp"
|
||||
}
|
||||
alt="sql-chat-logo"
|
||||
/>
|
||||
<img src={isDarkMode ? "/chat-logo-and-text-dark-mode.webp" : "/chat-logo-and-text.webp"} alt="sql-chat-logo" />
|
||||
</div>
|
||||
<div className="w-full grid grid-cols-2 sm:grid-cols-3 gap-4">
|
||||
<div className="w-full flex flex-col justify-start items-center">
|
||||
|
Reference in New Issue
Block a user