Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 1x 4x | import React from "react";
import { Link } from "react-router-dom";
export interface LinkProps {
to: string;
name: React.ReactNode | string;
classes?: string;
}
export const MyLink: React.FC<LinkProps> = ({ to, name, classes }) => {
return (
<Link
to={to}
className={`text-white rounded-lg border-black text-center bg-[#1111ff] p-[20px] ${
classes ?? ""
}`}
>
{typeof name === "string" ? (
name
) : (
<div className="flex flex-row">{name}</div>
)}
</Link>
);
};
|