Update localization files and remove unused files

This commit is contained in:
n4ze3m
2024-04-06 21:51:13 +05:30
parent 0ec5621b89
commit e96a579e02
22 changed files with 212 additions and 31 deletions

View File

@@ -53,7 +53,7 @@ export const SettingsLayout = ({ children }: { children: React.ReactNode }) => {
return (
<>
<div className="mx-auto max-w-7xl lg:flex lg:gap-x-16 lg:px-8">
<aside className="flex lg:rounded-md bg-white lg:p-4 lg:mt-20 overflow-x-auto lg:border-0 border-b py-4 lg:block lg:w-64 lg:flex-none dark:bg-[#171717] dark:border-gray-600">
<aside className="flex lg:rounded-md bg-white lg:p-4 lg:mt-20 overflow-x-auto lg:border-0 border-b py-4 lg:block lg:w-72 lg:flex-none dark:bg-[#171717] dark:border-gray-600">
<nav className="flex-none px-4 sm:px-6 lg:px-0">
<ul
role="list"

View File

@@ -14,7 +14,7 @@ type Props = {
}
export const AddKnowledge = ({ open, setOpen }: Props) => {
const { t } = useTranslation("knowledge")
const { t } = useTranslation(["knowledge", "common"])
const [form] = Form.useForm()
const onUploadHandler = async (data: {
@@ -51,6 +51,7 @@ export const AddKnowledge = ({ open, setOpen }: Props) => {
onSuccess: async (id) => {
message.success(t("form.success"))
PubSub.publish(KNOWLEDGE_QUEUE, id)
form.resetFields()
setOpen(false)
}
})

View File

@@ -9,13 +9,10 @@ import { KnowledgeIcon } from "./KnowledgeIcon"
import { useMessageOption } from "@/hooks/useMessageOption"
export const KnowledgeSettings = () => {
const { t } = useTranslation(["knownledge", "common"])
const { t } = useTranslation(["knowledge", "common"])
const [open, setOpen] = useState(false)
const queryClient = useQueryClient()
const {
selectedKnowledge,
setSelectedKnowledge
} = useMessageOption()
const { selectedKnowledge, setSelectedKnowledge } = useMessageOption()
const { data, status } = useQuery({
queryKey: ["fetchAllKnowledge"],
@@ -38,6 +35,12 @@ export const KnowledgeSettings = () => {
}
})
const statusColor = {
finished: "green",
processing: "blue",
pending: "gray"
}
return (
<div>
<div>
@@ -68,7 +71,7 @@ export const KnowledgeSettings = () => {
dataIndex: "status",
key: "status",
render: (text: string) => (
<Tag color="blue">{t(`status.${text}`)}</Tag>
<Tag color={statusColor[text]}>{t(`status.${text}`)}</Tag>
)
},
{
@@ -93,7 +96,7 @@ export const KnowledgeSettings = () => {
onClick={() => {
if (window.confirm(t("confirm.delete"))) {
deleteKnowledgeMutation(record.id)
if(selectedKnowledge.id === record.id) {
if (selectedKnowledge.id === record.id) {
setSelectedKnowledge(null)
}
}