diff --git a/apps/web/src/features/sharing/components/SharePanel.tsx b/apps/web/src/features/sharing/components/SharePanel.tsx index b4da0a8..a8e2fa7 100644 --- a/apps/web/src/features/sharing/components/SharePanel.tsx +++ b/apps/web/src/features/sharing/components/SharePanel.tsx @@ -1,5 +1,6 @@ import { useStore as useFormStore } from '@tanstack/react-form' import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query' +import type { ReactNode } from 'react' import { api, json, read } from '../../../shared/api.ts' import { useAppForm } from '../../../shared/form.tsx' import { ErrorAlert } from '../../../shared/ui/Alert.tsx' @@ -37,21 +38,19 @@ export function SharePanel(props: Props) { const settings = useQuery(sharingQuery(props.skey)) if (settings.error) return ( - + - - + ) if (!settings.data) return ( - + {/* The mode's select and Save, on their way. */} - - + ) return ( )} - + @@ -128,10 +127,19 @@ function SharingForm(props: SharingFormProps) { ) } -interface CloseButtonProps { +interface SharingCardProps { onClose: () => void + className?: string + /** What stands in for the form: why it couldn't load, or its controls on their way. */ + children: ReactNode } -function CloseButton(props: CloseButtonProps) { - return +/** The sharing panel before its form can show, with Close after what it holds. */ +function SharingCard(props: SharingCardProps) { + return ( + + {props.children} + + + ) }