fix: tranbox ui
This commit is contained in:
@@ -8,6 +8,7 @@ import { useEffect, useState } from "react";
|
|||||||
import { apiTranslate, apiBaiduLangdetect } from "../../apis";
|
import { apiTranslate, apiBaiduLangdetect } from "../../apis";
|
||||||
import CopyBtn from "./CopyBtn";
|
import CopyBtn from "./CopyBtn";
|
||||||
import Typography from "@mui/material/Typography";
|
import Typography from "@mui/material/Typography";
|
||||||
|
import Alert from "@mui/material/Alert";
|
||||||
|
|
||||||
export default function TranCont({
|
export default function TranCont({
|
||||||
text,
|
text,
|
||||||
@@ -59,7 +60,13 @@ export default function TranCont({
|
|||||||
if (simpleStyle) {
|
if (simpleStyle) {
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<Typography style={{ whiteSpace: "pre-line" }}>{trText}</Typography>
|
{error ? (
|
||||||
|
<Alert severity="error">{error}</Alert>
|
||||||
|
) : loading ? (
|
||||||
|
<CircularProgress size={16} />
|
||||||
|
) : (
|
||||||
|
<Typography style={{ whiteSpace: "pre-line" }}>{trText}</Typography>
|
||||||
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user