Просмотр исходного кода

如果单词有视频附件。在词头显示视频标签

visuddhinanda 3 лет назад
Родитель
Сommit
46713e4daf

+ 14 - 0
dashboard/src/components/template/Wbw/WbwVideoButton.tsx

@@ -0,0 +1,14 @@
+import { VideoCameraOutlined } from "@ant-design/icons";
+
+export interface IVideo {
+  url?: string;
+  title?: string;
+}
+interface IWidget {
+  video?: IVideo[];
+}
+const Widget = ({ video }: IWidget) => {
+  return video ? <VideoCameraOutlined /> : <></>;
+};
+
+export default Widget;

+ 2 - 0
dashboard/src/components/template/Wbw/WbwWord.tsx

@@ -1,4 +1,5 @@
 import { useState, useEffect, useRef } from "react";
+import type { UploadFile } from "antd/es/upload/interface";
 
 import { useAppSelector } from "../../../hooks";
 import { add, wordIndex } from "../../../reducers/inline-dict";
@@ -72,6 +73,7 @@ export interface IWbw {
   bookMarkText?: WbwElement;
   locked?: boolean;
   confidence: number;
+  attachments?: UploadFile[];
 }
 export interface IWbwFields {
   meaning?: boolean;