@@ -14,6 +14,7 @@ import { SENDER_ID, SENDER_NAME } from "@calcom/lib/constants";
1414import { formatPhoneNumber } from "@calcom/lib/formatPhoneNumber" ;
1515import { useHasActiveTeamPlan } from "@calcom/lib/hooks/useHasPaidPlan" ;
1616import { useLocale } from "@calcom/lib/hooks/useLocale" ;
17+ import useMediaQuery from "@calcom/lib/hooks/useMediaQuery" ;
1718import { HttpError } from "@calcom/lib/http-error" ;
1819import { getTimeFormatStringFromUserTimeFormat } from "@calcom/lib/timeFormat" ;
1920import {
@@ -165,6 +166,8 @@ export default function WorkflowStepContainer(props: WorkflowStepProps) {
165166 { enabled : ! ! teamId }
166167 ) ;
167168
169+ const isMobile = useMediaQuery ( "(max-width: 569px)" ) ;
170+
168171 const { data : userTeams } = trpc . viewer . teams . list . useQuery ( { } , { enabled : ! teamId } ) ;
169172 const [ agentConfigurationSheet , setAgentConfigurationSheet ] = useState < {
170173 open : boolean ;
@@ -842,7 +845,7 @@ export default function WorkflowStepContainer(props: WorkflowStepProps) {
842845 </ DropdownMenuItem >
843846 </ DropdownMenuContent >
844847 </ Dropdown >
845- ) : (
848+ ) : ! isMobile ? (
846849 < >
847850 < Button
848851 color = "secondary"
@@ -864,7 +867,7 @@ export default function WorkflowStepContainer(props: WorkflowStepProps) {
864867 { t ( "test_web_call" ) }
865868 </ Button >
866869 </ >
867- ) }
870+ ) : null }
868871 < Dropdown >
869872 < DropdownMenuTrigger asChild >
870873 < Button
@@ -876,6 +879,34 @@ export default function WorkflowStepContainer(props: WorkflowStepProps) {
876879 />
877880 </ DropdownMenuTrigger >
878881 < DropdownMenuContent >
882+ { isMobile && arePhoneNumbersActive . length <= 0 && (
883+ < >
884+ < DropdownMenuItem >
885+ < DropdownItem
886+ type = "button"
887+ StartIcon = "plus"
888+ disabled = { props . readOnly }
889+ onClick = { ( ) => {
890+ setAgentConfigurationSheet ( ( prev ) => ( {
891+ ...prev ,
892+ open : true ,
893+ activeTab : "phoneNumber" ,
894+ } ) ) ;
895+ } } >
896+ { t ( "connect_phone_number" ) }
897+ </ DropdownItem >
898+ </ DropdownMenuItem >
899+ < DropdownMenuItem >
900+ < DropdownItem
901+ type = "button"
902+ onClick = { ( ) => setIsWebCallDialogOpen ( true ) }
903+ disabled = { props . readOnly }
904+ StartIcon = "monitor" >
905+ { t ( "test_web_call" ) }
906+ </ DropdownItem >
907+ </ DropdownMenuItem >
908+ </ >
909+ ) }
879910 < DropdownMenuItem >
880911 < DropdownItem
881912 type = "button"
@@ -1489,22 +1520,22 @@ export default function WorkflowStepContainer(props: WorkflowStepProps) {
14891520 subscriptionStatus : phone . subscriptionStatus ?? undefined ,
14901521 } ) )
14911522 ) . length > 0 && (
1492- < div className = "bg-muted rounded-lg p-3" >
1493- < div className = "flex items-center gap-2" >
1494- < Icon name = "phone" className = "text-emphasis h-4 w-4" />
1495- < span className = "text-emphasis text-sm font-medium" >
1496- { formatPhoneNumber (
1497- getActivePhoneNumbers (
1498- agentData ?. outboundPhoneNumbers ?. map ( ( phone ) => ( {
1499- ...phone ,
1500- subscriptionStatus : phone . subscriptionStatus ?? undefined ,
1501- } ) )
1502- ) ?. [ 0 ] ?. phoneNumber
1503- ) }
1504- </ span >
1505- </ div >
1523+ < div className = "bg-muted rounded-lg p-3" >
1524+ < div className = "flex items-center gap-2" >
1525+ < Icon name = "phone" className = "text-emphasis h-4 w-4" />
1526+ < span className = "text-emphasis text-sm font-medium" >
1527+ { formatPhoneNumber (
1528+ getActivePhoneNumbers (
1529+ agentData ?. outboundPhoneNumbers ?. map ( ( phone ) => ( {
1530+ ...phone ,
1531+ subscriptionStatus : phone . subscriptionStatus ?? undefined ,
1532+ } ) )
1533+ ) ?. [ 0 ] ?. phoneNumber
1534+ ) }
1535+ </ span >
15061536 </ div >
1507- ) }
1537+ </ div >
1538+ ) }
15081539 < p className = "text-subtle text-sm" > { t ( "the_action_will_disconnect_phone_number" ) } </ p >
15091540 </ div >
15101541 < DialogFooter showDivider >
0 commit comments