front-hub/src/components/UnderlinedLink.tsx

27 lines
700 B
TypeScript
Raw Normal View History

2022-11-17 12:25:23 +00:00
import { Link, SxProps, Theme, Typography } from "@mui/material";
interface Props {
text: string;
linkHref: string;
isHighlighted?: boolean;
sx?: SxProps<Theme>;
}
export default function UnderlinedLink({ text, linkHref, isHighlighted = false, sx }: Props) {
return (
<Link
href={linkHref}
color={isHighlighted ? "text.primary" : "text.secondary"}
underline="none"
sx={{
borderBottom: isHighlighted ? "1px solid #ffffff" : "1px solid #7E2AEA",
pb: "3px",
...sx,
}}
>
<Typography variant="medium">{text}</Typography>
</Link>
);
}