feat(frontend): add BackLink helper + dedup 3 hand-rolled instances
BackLink: ArrowLeft (14px) + caption-md text-graphite hover:text-primary, instant. Replaces inline Link patterns in EngagementDetailPage (already committed), SimulationFormPage, and TemplateFormPage. Also migrates SimulationFormPage Done/SOC banners to AlertBanner. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
17
frontend/src/components/BackLink.tsx
Normal file
17
frontend/src/components/BackLink.tsx
Normal file
@@ -0,0 +1,17 @@
|
||||
import { Link } from 'react-router-dom';
|
||||
import { ArrowLeft } from 'lucide-react';
|
||||
import type { ReactNode } from 'react';
|
||||
|
||||
interface BackLinkProps {
|
||||
to: string;
|
||||
children: ReactNode;
|
||||
}
|
||||
|
||||
export function BackLink({ to, children }: BackLinkProps): JSX.Element {
|
||||
return (
|
||||
<Link to={to} className="inline-flex items-center gap-xxs caption-md text-graphite hover:text-primary">
|
||||
<ArrowLeft size={14} aria-hidden />
|
||||
{children}
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user