Files
Checkmate/client/src/Components/TextLink/index.jsx
T

36 lines
761 B
React
Raw Normal View History

2025-06-11 10:20:36 +08:00
import Typography from "@mui/material/Typography";
import Stack from "@mui/material/Stack";
import Link from "@mui/material/Link";
import PropTypes from "prop-types";
import { useTheme } from "@emotion/react";
import { Link as RouterLink } from "react-router-dom";
2025-06-23 10:02:06 +08:00
const TextLink = ({ text, linkText, href, target = "_self" }) => {
2025-06-11 10:20:36 +08:00
const theme = useTheme();
return (
<Stack
direction="row"
gap={theme.spacing(4)}
>
<Typography>{text}</Typography>
<Link
color="accent"
to={href}
component={RouterLink}
2025-06-23 10:02:06 +08:00
target={target}
2025-06-11 10:20:36 +08:00
>
{linkText}
</Link>
</Stack>
);
};
TextLink.propTypes = {
text: PropTypes.string,
linkText: PropTypes.string,
href: PropTypes.string,
2025-06-23 10:02:06 +08:00
target: PropTypes.string,
2025-06-11 10:20:36 +08:00
};
export default TextLink;