mirror of
https://github.com/sqlchat/sqlchat.git
synced 2025-09-26 01:23:18 +08:00
chore: import locale from dayjs
This commit is contained in:
@ -6,7 +6,7 @@ import { useTranslation } from "react-i18next";
|
|||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import ReactMarkdown from "react-markdown";
|
import ReactMarkdown from "react-markdown";
|
||||||
import remarkGfm from "remark-gfm";
|
import remarkGfm from "remark-gfm";
|
||||||
import { useConversationStore, useConnectionStore, useMessageStore, useUserStore } from "@/store";
|
import { useConversationStore, useConnectionStore, useMessageStore, useUserStore, useSettingStore } from "@/store";
|
||||||
import { Message } from "@/types";
|
import { Message } from "@/types";
|
||||||
import Icon from "../Icon";
|
import Icon from "../Icon";
|
||||||
import { CodeBlock } from "../CodeBlock";
|
import { CodeBlock } from "../CodeBlock";
|
||||||
@ -19,6 +19,7 @@ interface Props {
|
|||||||
const MessageView = (props: Props) => {
|
const MessageView = (props: Props) => {
|
||||||
const message = props.message;
|
const message = props.message;
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const settingStore = useSettingStore();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const conversationStore = useConversationStore();
|
const conversationStore = useConversationStore();
|
||||||
const connectionStore = useConnectionStore();
|
const connectionStore = useConnectionStore();
|
||||||
@ -106,7 +107,9 @@ const MessageView = (props: Props) => {
|
|||||||
>
|
>
|
||||||
{message.content}
|
{message.content}
|
||||||
</ReactMarkdown>
|
</ReactMarkdown>
|
||||||
<span className="self-end text-sm text-gray-400 pt-1 pr-1">{dayjs(message.createdAt).format("lll")}</span>
|
<span className="self-end text-sm text-gray-400 pt-1 pr-1">
|
||||||
|
{dayjs(message.createdAt).locale(settingStore.setting.locale).format("lll")}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className={`invisible group-hover:visible ${showMenu && "!visible"}`}>
|
<div className={`invisible group-hover:visible ${showMenu && "!visible"}`}>
|
||||||
<button
|
<button
|
||||||
|
@ -5,9 +5,11 @@ import { AppProps } from "next/app";
|
|||||||
import React, { useEffect } from "react";
|
import React, { useEffect } from "react";
|
||||||
import { Toaster } from "react-hot-toast";
|
import { Toaster } from "react-hot-toast";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
dayjs.extend(localizedFormat);
|
|
||||||
import { useSettingStore } from "@/store";
|
import { useSettingStore } from "@/store";
|
||||||
|
|
||||||
|
dayjs.extend(localizedFormat);
|
||||||
|
import "dayjs/locale/zh";
|
||||||
|
|
||||||
import "@/locales/i18n";
|
import "@/locales/i18n";
|
||||||
import "@/styles/tailwind.css";
|
import "@/styles/tailwind.css";
|
||||||
import "@/styles/global.css";
|
import "@/styles/global.css";
|
||||||
|
Reference in New Issue
Block a user