ButtonLink.tsx
1 import React from "react"; 2 import { Link } from "@tanstack/react-router"; 3 import Button from "./Button.tsx"; 4 5 interface ButtonLinkProps { 6 to: string; 7 children: React.ReactNode; 8 style?: React.CSSProperties; 9 } 10 11 export default function ButtonLink({ 12 to, 13 children, 14 style, 15 }: ButtonLinkProps) { 16 return ( 17 <Button> 18 <Link 19 to={to} 20 search={(prev: Record<string, string>) => ({ 21 shopId: prev.shopId, 22 })} 23 style={{ 24 color: "white", 25 ...style, 26 }} 27 > 28 <div className="flex gap-2 items-center"> 29 <p>{children}</p> 30 <img 31 src="/icons/white-arrow.svg" 32 alt="white-arrow" 33 width={7} 34 height={12} 35 /> 36 </div> 37 </Link> 38 </Button> 39 ); 40 }