Skip to content

Commit

Permalink
Merge pull request #38 from hyzx86/addMd
Browse files Browse the repository at this point in the history
Add markdown file support in knowledge form
  • Loading branch information
n4ze3m authored Apr 16, 2024
2 parents aeefb00 + 5089bb5 commit d479283
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/assets/locale/en/knowledge.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"uploadFile": {
"label": "Upload File",
"uploadText": "Drag and drop a file here or click to upload",
"uploadHint": "Supported file types: .pdf, .csv, .txt",
"uploadHint": "Supported file types: .pdf, .csv, .txt, .md",
"required": "File is required"
},
"submit": "Submit",
Expand Down
2 changes: 1 addition & 1 deletion src/assets/locale/ml/knowledge.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"uploadFile": {
"label": "ഫയല്‍ അപ്‌ലോഡ് ചെയ്യുക",
"uploadText": "ഇവിടെ ഒരു ഫയല്‍ എടുത്തിടുക അല്ലെങ്കില്‍ അപ്‌ലോഡ് ചെയ്യാന്‍ ക്ലിക്ക് ചെയ്യുക",
"uploadHint": "പിന്തുണയുള്ള ഫയല്‍ തരങ്ങള്‍: .pdf, .csv, .txt",
"uploadHint": "പിന്തുണയുള്ള ഫയല്‍ തരങ്ങള്‍: .pdf, .csv, .txt, .md",
"required": "ഫയല്‍ ആവശ്യമാണ്"
},
"submit": "സമര്‍പ്പിക്കുക",
Expand Down
2 changes: 1 addition & 1 deletion src/assets/locale/zh/knowledge.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"uploadFile": {
"label": "上传文件",
"uploadText": "将文件拖放到此处或点击上传",
"uploadHint": "支持的文件类型: .pdf, .csv, .txt",
"uploadHint": "支持的文件类型: .pdf, .csv, .txt, .md",
"required": "文件是必需的"
},
"submit": "提交",
Expand Down
8 changes: 4 additions & 4 deletions src/components/Option/Knowledge/AddKnowledge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const AddKnowledge = ({ open, setOpen }: Props) => {
return e?.fileList
}}>
<Upload.Dragger
accept={".pdf, .csv, .txt"}
accept={".pdf, .csv, .txt, .md"}
multiple={true}
maxCount={10}
beforeUpload={(file) => {
Expand All @@ -113,8 +113,8 @@ export const AddKnowledge = ({ open, setOpen }: Props) => {
return false
}}>
<div className="p-3">
<p className="ant-upload-drag-icon justify-center flex">
<InboxIcon className="h-10 w-10 text-gray-400" />
<p className="flex justify-center ant-upload-drag-icon">
<InboxIcon className="w-10 h-10 text-gray-400" />
</p>
<p className="ant-upload-text">
{t("form.uploadFile.uploadText")}
Expand All @@ -130,7 +130,7 @@ export const AddKnowledge = ({ open, setOpen }: Props) => {
<button
type="submit"
disabled={isSaving}
className="inline-flex w-full text-center justify-center items-center rounded-md border border-transparent bg-black px-2 py-2 text-md font-medium leading-4 text-white shadow-sm hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 dark:bg-white dark:text-gray-800 dark:hover:bg-gray-100 dark:focus:ring-gray-500 dark:focus:ring-offset-gray-100 disabled:opacity-50">
className="inline-flex items-center justify-center w-full px-2 py-2 font-medium leading-4 text-center text-white bg-black border border-transparent rounded-md shadow-sm text-md hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 dark:bg-white dark:text-gray-800 dark:hover:bg-gray-100 dark:focus:ring-gray-500 dark:focus:ring-offset-gray-100 disabled:opacity-50">
{t("form.submit")}
</button>
</Form.Item>
Expand Down

0 comments on commit d479283

Please sign in to comment.