New 'Truncated Link' component for shared styling

This commit is contained in:
sam-keen 2022-03-30 10:30:05 +01:00
parent 75017feada
commit 6c274e5375

View File

@ -0,0 +1,27 @@
import { TruncateInline } from './truncate';
import { Link } from 'react-router-dom';
interface TruncatedLinkProps {
to: string;
text: string;
startChars: number;
endChars: number;
}
export const TruncatedLink = ({
to,
text,
startChars,
endChars,
}: TruncatedLinkProps) => {
return (
<Link to={to}>
<TruncateInline
text={text}
startChars={startChars}
endChars={endChars}
className="font-mono font-bold underline dark:text-vega-yellow dark:font-normal dark:no-underline"
/>
</Link>
);
};