···22 import { Alert, Button, Input, Subheading } from '@foxui/core';
33 import Modal from '$lib/components/modal/Modal.svelte';
44 import type { CreationModalComponentProps } from '../../types';
55+ import { getRecord } from '$lib/atproto/methods';
66+ import type { Did } from '@atcute/lexicons';
5768 const EVENT_COLLECTION = 'community.lexicon.calendar.event';
79···3840 throw new Error('Invalid URL format');
3941 }
40424141- // Validate the event exists by fetching it
4242- const response = await fetch(
4343- `https://smokesignal.events/xrpc/community.lexicon.calendar.GetEvent?repository=${encodeURIComponent(parsed.did)}&record_key=${encodeURIComponent(parsed.rkey)}`
4444- );
4343+ // Validate the event exists by fetching the record directly
4444+ const record = await getRecord({
4545+ did: parsed.did as Did,
4646+ collection: EVENT_COLLECTION,
4747+ rkey: parsed.rkey
4848+ });
45494646- if (!response.ok) {
5050+ if (!record?.value) {
4751 throw new Error('Event not found');
4852 }
4953···5559 errorMessage =
5660 err instanceof Error && err.message === 'Event not found'
5761 ? "Couldn't find that event. Please check the URL and try again."
5858- : 'Invalid URL. Please enter a valid smokesignal.events URL or AT URI.';
6262+ : 'Invalid URL. Please enter a valid event AT URI or smokesignal.events URL.';
5963 return false;
6064 } finally {
6165 isValidating = false;
···7074 }}
7175 class="flex flex-col gap-2"
7276 >
7373- <Subheading>Enter a Smoke Signal event URL</Subheading>
7777+ <Subheading>Enter an event URL</Subheading>
7478 <Input
7579 bind:value={eventUrl}
7676- placeholder="https://smokesignal.events/did:.../..."
8080+ placeholder="at://did:.../community.lexicon.calendar.event/..."
7781 class="mt-4"
7882 />
7983···8286 {/if}
83878488 <p class="text-base-500 dark:text-base-400 mt-2 text-xs">
8585- Paste a URL from <a
8686- href="https://smokesignal.events"
8787- class="text-accent-800 dark:text-accent-300"
8888- target="_blank">smokesignal.events</a
8989- > or an AT URI for a calendar event.
8989+ Paste an AT URI for a calendar event or a smokesignal.events URL.
9090 </p>
91919292 <div class="mt-4 flex justify-end gap-2">