front-hub/src/components/UnderlinedLink.tsx

31 lines
822 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>;
2022-11-19 12:39:57 +00:00
endIcon?: React.ReactNode;
2022-11-17 12:25:23 +00:00
}
2022-11-19 12:39:57 +00:00
export default function UnderlinedLink({ text, linkHref, isHighlighted = false, sx, endIcon }: Props) {
2022-11-17 12:25:23 +00:00
return (
<Link
href={linkHref}
color={isHighlighted ? "text.primary" : "text.secondary"}
underline="none"
sx={{
2022-11-19 12:39:57 +00:00
display: "flex",
gap: "3px",
2022-11-17 12:25:23 +00:00
borderBottom: isHighlighted ? "1px solid #ffffff" : "1px solid #7E2AEA",
pb: "3px",
...sx,
}}
>
2022-11-19 12:39:57 +00:00
<Typography variant="body2">{text}</Typography>
{endIcon}
2022-11-17 12:25:23 +00:00
</Link>
);
}