|
@@ -10,7 +10,7 @@ import {
|
|
|
|
|
|
|
|
import "./wbw.css";
|
|
import "./wbw.css";
|
|
|
import WbwDetail from "./WbwDetail";
|
|
import WbwDetail from "./WbwDetail";
|
|
|
-import { IWbw, TWbwDisplayMode } from "./WbwWord";
|
|
|
|
|
|
|
+import { IWbw, IWbwAttachment, TWbwDisplayMode } from "./WbwWord";
|
|
|
import { bookMarkColor } from "./WbwDetailBookMark";
|
|
import { bookMarkColor } from "./WbwDetailBookMark";
|
|
|
import WbwVideoButton from "./WbwVideoButton";
|
|
import WbwVideoButton from "./WbwVideoButton";
|
|
|
import CommentBox from "../../discussion/DiscussionDrawer";
|
|
import CommentBox from "../../discussion/DiscussionDrawer";
|
|
@@ -24,6 +24,29 @@ import { anchor, showWbw } from "../../../reducers/wbw";
|
|
|
import { CommentOutlinedIcon } from "../../../assets/icon";
|
|
import { CommentOutlinedIcon } from "../../../assets/icon";
|
|
|
import { ParaLinkCtl } from "../ParaLink";
|
|
import { ParaLinkCtl } from "../ParaLink";
|
|
|
|
|
|
|
|
|
|
+//生成视频播放按钮
|
|
|
|
|
+interface IVideoIcon {
|
|
|
|
|
+ attachments?: IWbwAttachment[];
|
|
|
|
|
+}
|
|
|
|
|
+const VideoIcon = ({ attachments }: IVideoIcon) => {
|
|
|
|
|
+ const videoList = attachments?.filter((item) =>
|
|
|
|
|
+ item.content_type?.includes("video")
|
|
|
|
|
+ );
|
|
|
|
|
+ return videoList ? (
|
|
|
|
|
+ <WbwVideoButton
|
|
|
|
|
+ video={videoList?.map((item) => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ videoId: item.id,
|
|
|
|
|
+ type: item.content_type,
|
|
|
|
|
+ title: item.title,
|
|
|
|
|
+ };
|
|
|
|
|
+ })}
|
|
|
|
|
+ />
|
|
|
|
|
+ ) : (
|
|
|
|
|
+ <></>
|
|
|
|
|
+ );
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
const { Paragraph } = Typography;
|
|
const { Paragraph } = Typography;
|
|
|
interface IWidget {
|
|
interface IWidget {
|
|
|
data: IWbw;
|
|
data: IWbw;
|
|
@@ -189,26 +212,6 @@ const WbwPaliWidget = ({ data, channelId, mode, display, onSave }: IWidget) => {
|
|
|
? bookMarkColor[data.bookMarkColor.value]
|
|
? bookMarkColor[data.bookMarkColor.value]
|
|
|
: "white";
|
|
: "white";
|
|
|
|
|
|
|
|
- //生成视频播放按钮
|
|
|
|
|
- const VideoIcon = () => {
|
|
|
|
|
- const videoList = data.attachments?.filter((item) =>
|
|
|
|
|
- item.content_type?.includes("video")
|
|
|
|
|
- );
|
|
|
|
|
- return videoList ? (
|
|
|
|
|
- <WbwVideoButton
|
|
|
|
|
- video={videoList?.map((item) => {
|
|
|
|
|
- return {
|
|
|
|
|
- videoId: item.id,
|
|
|
|
|
- type: item.content_type,
|
|
|
|
|
- title: item.title,
|
|
|
|
|
- };
|
|
|
|
|
- })}
|
|
|
|
|
- />
|
|
|
|
|
- ) : (
|
|
|
|
|
- <></>
|
|
|
|
|
- );
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
const RelationIcon = () => {
|
|
const RelationIcon = () => {
|
|
|
return data.relation ? (
|
|
return data.relation ? (
|
|
|
<ApartmentOutlined style={{ color: "blue" }} />
|
|
<ApartmentOutlined style={{ color: "blue" }} />
|
|
@@ -375,7 +378,7 @@ const WbwPaliWidget = ({ data, channelId, mode, display, onSave }: IWidget) => {
|
|
|
</Popover>
|
|
</Popover>
|
|
|
</span>
|
|
</span>
|
|
|
<Space>
|
|
<Space>
|
|
|
- <VideoIcon />
|
|
|
|
|
|
|
+ <VideoIcon attachments={data.attachments} />
|
|
|
<NoteIcon />
|
|
<NoteIcon />
|
|
|
<BookMarkIcon />
|
|
<BookMarkIcon />
|
|
|
<RelationIcon />
|
|
<RelationIcon />
|