feat: word pronunciation supported
This commit is contained in:
@@ -2,10 +2,11 @@ import Box from "@mui/material/Box";
|
||||
import Stack from "@mui/material/Stack";
|
||||
import FavBtn from "./FavBtn";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import AudioBtn from "./AudioBtn";
|
||||
|
||||
const phonicMap = {
|
||||
en_phonic: "英",
|
||||
us_phonic: "美",
|
||||
en_phonic: ["英", "uk"],
|
||||
us_phonic: ["美", "en"],
|
||||
};
|
||||
|
||||
export default function DictCont({ dictResult }) {
|
||||
@@ -27,13 +28,17 @@ export default function DictCont({ dictResult }) {
|
||||
</Stack>
|
||||
|
||||
<Typography component="div">
|
||||
<Typography>
|
||||
<Stack direction="row">
|
||||
{dictResult.voice
|
||||
?.map(Object.entries)
|
||||
.map((item) => item[0])
|
||||
.map(([key, val]) => `${phonicMap[key] || key} ${val}`)
|
||||
.join(" ")}
|
||||
</Typography>
|
||||
.map(([key, val]) => (
|
||||
<span>
|
||||
<span>{`${phonicMap[key]?.[0] || key} ${val}`}</span>
|
||||
<AudioBtn text={dictResult.src} lan={phonicMap[key]?.[1]} />
|
||||
</span>
|
||||
))}
|
||||
</Stack>
|
||||
<ul style={{ margin: "0.5em 0" }}>
|
||||
{dictResult.content[0].mean.map(({ pre, cont }, idx) => (
|
||||
<li key={idx}>
|
||||
|
||||
Reference in New Issue
Block a user