@@ -27,7 +27,6 @@ import {
2727 CopyField ,
2828 GeneralAccessSelect ,
2929 MakePublicCard ,
30- ShareCardHeader ,
3130 SharePeopleTab ,
3231 copyToClipboard ,
3332 useResourceVisibilityMutation ,
@@ -51,6 +50,7 @@ import {
5150} from "@/components/ui/popover" ;
5251import { Switch } from "@/components/ui/switch" ;
5352import { Tabs , TabsList , TabsTrigger , TabsContent } from "@/components/ui/tabs" ;
53+ import { cn } from "@/lib/utils" ;
5454
5555import { buildEmailPreviewMarkup } from "../../../shared/email-preview" ;
5656import { isLoomEmbedUrl } from "../../../shared/loom" ;
@@ -228,19 +228,12 @@ function ShareRecordingContent({
228228 absoluteAppUrl ( `/share/${ recordingId } ` ) ,
229229 ownerViaId ,
230230 ) ;
231- const titleText = recordingTitle
232- ? t ( "shareDialog.shareTitle" , { title : recordingTitle } )
233- : t ( "shareDialog.shareRecording" ) ;
234-
235231 return (
236232 < >
237- < ShareCardHeader
238- title = { titleText }
239- ownerEmail = { data ?. ownerEmail }
240- reserveCloseButton = { reserveCloseButton }
241- />
242-
243- < Tabs defaultValue = "link" className = "min-w-0 px-4 py-3" >
233+ < Tabs
234+ defaultValue = "link"
235+ className = { cn ( "min-w-0 px-4 py-3" , reserveCloseButton && "pe-12" ) }
236+ >
244237 < TabsList className = "grid w-full grid-cols-3" >
245238 < TabsTrigger value = "link" className = "gap-1.5" >
246239 < IconLink size = { 14 } />
@@ -441,6 +434,25 @@ function LinkTab({
441434 ? t ( "shareDialog.agentPrompt" , { agentContextUrl : agentLink } )
442435 : "" ;
443436 const [ agentDetailsOpen , setAgentDetailsOpen ] = useState ( false ) ;
437+ const showMakePublic = sharesLoaded && ! isPublic && canManage ;
438+ const downloadButton = videoUrl ? (
439+ < Button
440+ variant = "outline"
441+ size = "sm"
442+ className = { isLoomRecording ? "gap-1.5" : undefined }
443+ onClick = { ( ) => window . open ( videoUrl , "_blank" , "noopener,noreferrer" ) }
444+ >
445+ { isLoomRecording ? (
446+ < >
447+ < IconExternalLink className = "h-4 w-4" />
448+ { t ( "shareDialog.openPlayer" ) }
449+ </ >
450+ ) : (
451+ t ( "recordRoute.downloadRecording" )
452+ ) }
453+ </ Button >
454+ ) : null ;
455+ const moveDownloadIntoMakePublicRow = showMakePublic && Boolean ( videoUrl ) ;
444456
445457 useEffect ( ( ) => {
446458 if ( isPublic ) setAgentDetailsOpen ( false ) ;
@@ -540,9 +552,12 @@ function LinkTab({
540552 </ Collapsible >
541553 ) : null }
542554
543- { sharesLoaded && ! isPublic && canManage ? (
555+ { showMakePublic ? (
544556 < MakePublicCard
545557 isPending = { isPending }
558+ secondaryAction = {
559+ moveDownloadIntoMakePublicRow ? downloadButton : undefined
560+ }
546561 onMakePublic = { ( ) =>
547562 setResourceVisibility ( "public" , {
548563 onSuccess : ( ) => copyToClipboard ( shareUrl ) ,
@@ -551,7 +566,9 @@ function LinkTab({
551566 />
552567 ) : null }
553568
554- { emailPreviewThumbnailUrl || videoUrl || animatedThumbnailUrl ? (
569+ { emailPreviewThumbnailUrl ||
570+ animatedThumbnailUrl ||
571+ ( videoUrl && ! moveDownloadIntoMakePublicRow ) ? (
555572 < div className = "flex flex-wrap gap-2" >
556573 { emailPreviewThumbnailUrl ? (
557574 < Button
@@ -571,25 +588,7 @@ function LinkTab({
571588 { t ( "shareDialog.gifPreview" ) }
572589 </ Button >
573590 ) : null }
574- { videoUrl ? (
575- < Button
576- variant = "outline"
577- size = "sm"
578- className = { isLoomRecording ? "gap-1.5" : undefined }
579- onClick = { ( ) =>
580- window . open ( videoUrl , "_blank" , "noopener,noreferrer" )
581- }
582- >
583- { isLoomRecording ? (
584- < >
585- < IconExternalLink className = "h-4 w-4" />
586- { t ( "shareDialog.openPlayer" ) }
587- </ >
588- ) : (
589- t ( "recordRoute.downloadRecording" )
590- ) }
591- </ Button >
592- ) : null }
591+ { ! moveDownloadIntoMakePublicRow ? downloadButton : null }
593592 </ div >
594593 ) : null }
595594 </ div >
0 commit comments