import { List, Popover, Typography, notification } from "antd"; import { Space } from "antd"; import User from "../../auth/User"; import Channel from "../../channel/Channel"; import TimeShow from "../../general/TimeShow"; import type { ISentence } from "../SentEdit" import { MergeIcon2 } from "../../../assets/icon"; import { useEffect, useState } from "react"; import { get } from "../../../request"; import type { ISentHistoryData, ISentHistoryListResponse, } from "../../corpus/SentHistory"; import moment from "moment"; const { Text } = Typography; interface IFork { sentId?: string; highlight?: boolean; } const Fork = ({ sentId, highlight = false }: IFork) => { const [data, setData] = useState(); useEffect(() => { if (sentId) { const url = `/v2/sent_history?view=sentence&id=${sentId}&fork=1`; get(url).then((json) => { if (json.ok) { setData(json.data.rows); } else { notification.error({ message: json.message }); } }); } }, [sentId]); return ( ( {"fork from"} {item.fork_studio?.nickName}-{item.fork_from?.name} {"on"} )} /> } > ); }; interface IMergeButton { data: ISentence; } const MergeButton = ({ data }: IMergeButton) => { if (data.forkAt) { const fork = moment(data.forkAt); const updated = moment(data.updateAt); if (fork.isSame(updated)) { return ; } else { return ; } } else { return <>; } }; interface IDetailsWidget { data: ISentence; isPr?: boolean; } export const Details = ({ data, isPr }: IDetailsWidget) => ( {isPr ? <> : } {data.prEditAt ? ( ) : ( )} {data.acceptor ? ( ) : undefined} {data.acceptor ? "accept at" : undefined} {data.prEditAt ? ( ) : undefined} ); interface IWidget { data: ISentence; isPr?: boolean; compact?: boolean; } const EditInfoWidget = ({ data, isPr = false, compact = false }: IWidget) => { return (
{compact ? undefined :
}
); }; export default EditInfoWidget;