Forráskód Böngészése

add studio: IStudio;

visuddhinanda 3 éve
szülő
commit
ad81e1dd3d

+ 1 - 0
dashboard/src/components/api/Corpus.ts

@@ -157,6 +157,7 @@ export interface ISentenceData {
   html: string;
   editor: IUser;
   channel: IChannel;
+  studio: IStudio;
   updated_at: string;
   acceptor?: IUser;
   pr_edit_at?: string;

+ 2 - 0
dashboard/src/components/template/SentEdit.tsx

@@ -1,4 +1,5 @@
 import { Card } from "antd";
+import { IStudio } from "../auth/StudioName";
 
 import type { IUser } from "../auth/User";
 import { IChannel } from "../channel/Channel";
@@ -22,6 +23,7 @@ export interface ISentence {
   acceptor?: IUser;
   prEditAt?: string;
   channel: IChannel;
+  studio?: IStudio;
   updateAt: string;
   suggestionCount?: ISuggestionCount;
 }

+ 5 - 3
dashboard/src/components/template/SentEdit/EditInfo.tsx

@@ -1,7 +1,7 @@
 import { Typography } from "antd";
 import { Space } from "antd";
-import { useEffect, useRef } from "react";
 
+import StudioName from "../../auth/StudioName";
 import User from "../../auth/User";
 import TimeShow from "../../general/TimeShow";
 import { ISentence } from "../SentEdit";
@@ -10,13 +10,15 @@ const { Text } = Typography;
 
 interface IWidget {
   data: ISentence;
+  isPr?: boolean;
 }
-const Widget = ({ data }: IWidget) => {
+const Widget = ({ data, isPr = false }: IWidget) => {
   return (
     <div style={{ fontSize: "80%" }}>
       <Text type="secondary">
         <Space>
-          <User {...data.editor} />
+          {isPr ? undefined : <StudioName data={data.studio} />}
+          <User {...data.editor} showAvatar={isPr ? true : false} />
           <span>edit</span>
           {data.prEditAt ? (
             <TimeShow time={data.prEditAt} />