@@ -622,36 +622,7 @@ export default function TeamsPage() {
622622 } ,
623623 } ) ;
624624
625- const setAlwaysFreeMutation = useMutation ( {
626- mutationFn : async ( teamId : string ) => {
627- try {
628- const response = await put ( `/teams/${ teamId } ` , { is_always_free : true } ) ;
629- return response . json ( ) ;
630- } catch ( error ) {
631- if ( error instanceof Error ) {
632- throw new Error ( `Failed to set always-free status: ${ error . message } ` ) ;
633- } else {
634- throw new Error ( 'An unexpected error occurred while updating the team.' ) ;
635- }
636- }
637- } ,
638- onSuccess : ( ) => {
639- queryClient . invalidateQueries ( { queryKey : [ 'team' , selectedTeamId ] } ) ;
640- queryClient . invalidateQueries ( { queryKey : [ 'teams' ] } ) ;
641625
642- toast ( {
643- title : 'Success' ,
644- description : 'Team set to always-free successfully' ,
645- } ) ;
646- } ,
647- onError : ( error : Error ) => {
648- toast ( {
649- title : 'Error' ,
650- description : error . message ,
651- variant : 'destructive' ,
652- } ) ;
653- } ,
654- } ) ;
655626
656627 const createTeamSubscriptionMutation = useMutation ( {
657628 mutationFn : async ( { teamId, productId } : { teamId : string ; productId : string } ) => {
@@ -1004,28 +975,16 @@ export default function TeamsPage() {
1004975 Expired
1005976 </ Badge >
1006977 </ div >
1007- ) }
978+ ) }
1008979 { expandedTeam . is_always_free && (
1009980 < div >
1010981 < p className = "text-sm font-medium text-muted-foreground" > Always Free Status</ p >
1011- < div className = "flex items-center gap-2" >
1012- < Badge variant = "default" className = "bg-green-500 hover:bg-green-600" >
1013- Always Free
1014- </ Badge >
1015- < ConfirmationDialog
1016- title = "Resend Always-Free Request"
1017- description = "Are you sure you want to resend the always-free request email?"
1018- triggerText = "Resend Request"
1019- confirmText = "Resend"
1020- onConfirm = { ( ) => setAlwaysFreeMutation . mutate ( expandedTeam . id ) }
1021- isLoading = { setAlwaysFreeMutation . isPending }
1022- variant = "outline"
1023- size = "sm"
1024- />
1025- </ div >
982+ < Badge variant = "default" className = "bg-green-500 hover:bg-green-600" >
983+ Always Free
984+ </ Badge >
1026985 </ div >
1027986 ) }
1028- < div >
987+ < div >
1029988 < p className = "text-sm font-medium text-muted-foreground" > Created At</ p >
1030989 < p > { new Date ( expandedTeam . created_at ) . toLocaleString ( ) } </ p >
1031990 </ div >
@@ -1059,18 +1018,7 @@ export default function TeamsPage() {
10591018 ) : null }
10601019 Extend Trial
10611020 </ Button >
1062- { ! expandedTeam . is_always_free && (
1063- < ConfirmationDialog
1064- title = "Set Team to Always Free"
1065- description = "Are you sure you want to set this team to always-free? This will give them permanent free access."
1066- triggerText = "Set Always Free"
1067- confirmText = "Set Always Free"
1068- onConfirm = { ( ) => setAlwaysFreeMutation . mutate ( expandedTeam . id ) }
1069- isLoading = { setAlwaysFreeMutation . isPending }
1070- variant = "outline"
1071- size = "default"
1072- />
1073- ) }
1021+
10741022 { ( ! expandedTeam . users || expandedTeam . users . length === 0 ) && (
10751023 < DeleteConfirmationDialog
10761024 title = "Delete Team"
0 commit comments