diff --git a/src/components/ShipFit/FitLink.tsx b/src/components/ShipFit/FitLink.tsx index abc19b0..0194239 100644 --- a/src/components/ShipFit/FitLink.tsx +++ b/src/components/ShipFit/FitLink.tsx @@ -5,13 +5,13 @@ import { useExportEveShipFitHash } from "@/hooks/ExportEveShipFitHash"; import styles from "./ShipFit.module.css"; -export const FitLink = () => { +export const FitLink = (props: { isPreview?: boolean }) => { const link = useExportEveShipFitHash(); const { copy, copied } = useClipboard(); const isRemote = typeof window !== "undefined"; - const linkText = isRemote ? "open on eveship.fit" : "share fit"; + const linkText = props.isPreview ? "generated by eveship.fit" : isRemote ? "open on eveship.fit" : "share fit"; const linkPropsClick = React.useCallback( (e: React.MouseEvent) => { e.preventDefault(); @@ -22,7 +22,7 @@ export const FitLink = () => { [copy, link], ); const linkProps = { - onClick: isRemote ? undefined : linkPropsClick, + onClick: props.isPreview || isRemote ? undefined : linkPropsClick, }; if (link === null) return <>; diff --git a/src/components/ShipFit/ShipFit.tsx b/src/components/ShipFit/ShipFit.tsx index 46c62d3..0b137c3 100644 --- a/src/components/ShipFit/ShipFit.tsx +++ b/src/components/ShipFit/ShipFit.tsx @@ -20,7 +20,7 @@ import styles from "./ShipFit.module.css"; /** * Render a ship fit similar to how it is done in-game. */ -export const ShipFit = (props: { withStats?: boolean }) => { +export const ShipFit = (props: { withStats?: boolean; isPreview?: boolean }) => { const eveData = useEveData(); const statistics = useStatistics(); @@ -55,7 +55,7 @@ export const ShipFit = (props: { withStats?: boolean }) => { - + {props.withStats && (