diff --git a/src/lib/components/finds/FindCard.svelte b/src/lib/components/finds/FindCard.svelte
index d1dca54..1677f7a 100644
--- a/src/lib/components/finds/FindCard.svelte
+++ b/src/lib/components/finds/FindCard.svelte
@@ -53,6 +53,35 @@
function toggleComments() {
showComments = !showComments;
}
+
+ function handleShare() {
+ const url = `${window.location.origin}/finds/${id}`;
+
+ if (navigator.share) {
+ navigator
+ .share({
+ title: title,
+ text: description || `Check out this find: ${title}`,
+ url: url
+ })
+ .catch((error) => {
+ // User cancelled or error occurred
+ if (error.name !== 'AbortError') {
+ console.error('Error sharing:', error);
+ }
+ });
+ } else {
+ // Fallback: Copy to clipboard
+ navigator.clipboard
+ .writeText(url)
+ .then(() => {
+ alert('Find URL copied to clipboard!');
+ })
+ .catch((error) => {
+ console.error('Error copying to clipboard:', error);
+ });
+ }
+ }
@@ -135,7 +164,7 @@
{commentCount || 'comment'}
-