SentContent.tsx 667 B

1234567891011121314151617181920212223242526272829
  1. import { ISentence } from "../SentEdit";
  2. import SentCell from "./SentCell";
  3. interface IWidgetSentContent {
  4. origin?: ISentence[];
  5. translation?: ISentence[];
  6. layout?: "row" | "column";
  7. }
  8. const Widget = ({
  9. origin,
  10. translation,
  11. layout = "column",
  12. }: IWidgetSentContent) => {
  13. return (
  14. <div style={{ display: "flex", flexDirection: layout }}>
  15. <div style={{ flex: "5", color: "#9f3a01" }}>
  16. {origin?.map((item, id) => {
  17. return <SentCell key={id} data={item} />;
  18. })}
  19. </div>
  20. <div style={{ flex: "5" }}>
  21. {translation?.map((item, id) => {
  22. return <SentCell key={id} data={item} />;
  23. })}
  24. </div>
  25. </div>
  26. );
  27. };
  28. export default Widget;