diff --git a/src/components/NeighborSumAvoidance.tsx b/src/components/NeighborSumAvoidance.tsx
index 6aee214..1defb8e 100644
--- a/src/components/NeighborSumAvoidance.tsx
+++ b/src/components/NeighborSumAvoidance.tsx
@@ -11,9 +11,10 @@ import SocialShare from '@/components/SocialShare';
interface NeighborSumAvoidanceProps {
showSocialShare?: boolean;
+ shareUrl?: string;
}
-const NeighborSumAvoidance = ({ showSocialShare = false }: NeighborSumAvoidanceProps) => {
+const NeighborSumAvoidance = ({ showSocialShare = false, shareUrl }: NeighborSumAvoidanceProps) => {
const [numberCount, setNumberCount] = useState(9);
const [mode, setMode] = useState<'default' | 'guided'>('default');
const [isActive, setIsActive] = useState(false);
@@ -383,7 +384,7 @@ const NeighborSumAvoidance = ({ showSocialShare = false }: NeighborSumAvoidanceP
{showSocialShare && (
diff --git a/src/pages/theme-pages/discrete-math/Graphs.tsx b/src/pages/theme-pages/discrete-math/Graphs.tsx
index c033615..c96c216 100644
--- a/src/pages/theme-pages/discrete-math/Graphs.tsx
+++ b/src/pages/theme-pages/discrete-math/Graphs.tsx
@@ -11,7 +11,8 @@ interface Interactive {
title: string;
description: string;
tags: string[];
- component: React.ComponentType<{ showSocialShare?: boolean }>;
+ path: string;
+ component: React.ComponentType<{ showSocialShare?: boolean; shareUrl?: string }>;
}
const interactives: Interactive[] = [
@@ -20,6 +21,7 @@ const interactives: Interactive[] = [
title: 'Neighbor Sum Avoidance',
description: 'Arrange numbers 1-9 in a circle so that the sum of two neighbors is never divisible by 3, 5, or 7. Two modes: default and guided!',
tags: ['graphs', 'cycles', 'constraints', 'puzzle', 'graph-theory'],
+ path: '/themes/discrete-math/graphs/neighbor-sum-avoidance',
component: NeighborSumAvoidance
},
];
@@ -36,6 +38,7 @@ const Graphs = () => {
if (selectedInteractive) {
const InteractiveComponent = selectedInteractive.component;
+ const shareUrl = `${window.location.origin}${selectedInteractive.path}`;
return (
@@ -47,7 +50,7 @@ const Graphs = () => {
← Back to Graphs
-
+
);