feat(forms): visible public link + one-click Copy on member and admin lists

- shared components/forms/copy-link-button.tsx (one control, no drift):
  copies the absolute /f/<space>/<slug> URL, check-mark + toast feedback
- admin /forms list: Copy link button on every published public form
- member /my-forms list: shows the /f/<space>/<slug> path and a Copy
  button for public forms; row restructured so the button is not nested
  in the row link
- members-only forms show no public link (correct: they have none)

337 tests; build verified. Local commit (deploy on your word).
This commit is contained in:
Moheeb Zara
2026-05-16 18:05:23 -07:00
parent 73eef7293a
commit 2559166092
3 changed files with 70 additions and 18 deletions
+4
View File
@@ -6,6 +6,7 @@ import { PageHeader, PageTitle } from '@/components/ui/page-title'
import { Button } from '@/components/ui/button'
import { Badge } from '@/components/ui/badge'
import { Empty, EmptyHeader, EmptyMedia, EmptyTitle, EmptyDescription } from '@/components/ui/empty'
import { CopyLinkButton } from '@/components/forms/copy-link-button'
type FormRow = {
id: string
@@ -76,6 +77,9 @@ export function FormsClient({ forms, spaceSlug }: { forms: FormRow[]; spaceSlug:
{f.status}
</Badge>
<div className="flex gap-2">
{f.visibility !== 'members' && f.status === 'published' && (
<CopyLinkButton path={`/f/${spaceSlug}/${f.slug}`} />
)}
<Button asChild size="sm" variant="ghost">
<Link href={`/forms/${f.id}/results`}>Results</Link>
</Button>