implement website share functionality using share table

- Add support for multiple share URLs per website with server-generated slugs
- Create shares API endpoint for listing and creating website shares
- Add SharesTable, ShareEditButton, ShareDeleteButton components
- Move share management to website settings, remove header share button
- Remove shareId from website update API (now uses separate share table)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Mike Cao 2026-01-20 16:45:02 -08:00
parent 3a498333a6
commit 0eb598c817
13 changed files with 374 additions and 127 deletions

View file

@ -1,14 +1,11 @@
import { Column } from '@umami/react-zen';
import { Panel } from '@/components/common/Panel';
import { useWebsite } from '@/components/hooks';
import { WebsiteData } from './WebsiteData';
import { WebsiteEditForm } from './WebsiteEditForm';
import { WebsiteShareForm } from './WebsiteShareForm';
import { WebsiteTrackingCode } from './WebsiteTrackingCode';
export function WebsiteSettings({ websiteId }: { websiteId: string; openExternal?: boolean }) {
const website = useWebsite();
return (
<Column gap="6">
<Panel>
@ -18,7 +15,7 @@ export function WebsiteSettings({ websiteId }: { websiteId: string; openExternal
<WebsiteTrackingCode websiteId={websiteId} />
</Panel>
<Panel>
<WebsiteShareForm websiteId={websiteId} shareId={website.shareId} />
<WebsiteShareForm websiteId={websiteId} />
</Panel>
<Panel>
<WebsiteData websiteId={websiteId} />