SentRead.tsx 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import { Tooltip, Button } from "antd";
  2. import MdView from "./MdView";
  3. interface IWidgetSentReadFrame {
  4. origin?: string[];
  5. translation?: string[];
  6. layout?: "row" | "column";
  7. sentId?: string;
  8. }
  9. const SentReadFrame = ({
  10. origin,
  11. translation,
  12. layout = "column",
  13. sentId,
  14. }: IWidgetSentReadFrame) => {
  15. return (
  16. <Tooltip
  17. placement="topLeft"
  18. color="white"
  19. title={
  20. <Button type="link" size="small">
  21. aa
  22. </Button>
  23. }
  24. >
  25. <div style={{ display: "flex", flexDirection: layout }}>
  26. <div style={{ flex: "5", color: "#9f3a01" }}>
  27. {origin?.map((item, id) => {
  28. return <MdView key={id} html={item} />;
  29. })}
  30. </div>
  31. <div style={{ flex: "5" }}>
  32. {translation?.map((item, id) => {
  33. return <MdView key={id} html={item} />;
  34. })}
  35. </div>
  36. </div>
  37. </Tooltip>
  38. );
  39. };
  40. interface IWidgetTerm {
  41. props: string;
  42. }
  43. const Widget = ({ props }: IWidgetTerm) => {
  44. const prop = JSON.parse(atob(props)) as IWidgetSentReadFrame;
  45. return (
  46. <>
  47. <SentReadFrame {...prop} />
  48. </>
  49. );
  50. };
  51. export default Widget;