@@ -83,7 +83,7 @@ export const AddTemplate = ({ environmentId, baseUrl }: Props) => {
8383 const [ open , setOpen ] = useState ( false ) ;
8484 const [ viewMode , setViewMode ] = useState < "detailed" | "icon" > ( "detailed" ) ;
8585 const [ selectedTags , setSelectedTags ] = useState < string [ ] > ( [ ] ) ;
86- const [ showFavoritesOnly , setShowFavoritesOnly ] = useState ( false ) ;
86+ const [ showBookmarksOnly , setShowBookmarksOnly ] = useState ( false ) ;
8787 const [ customBaseUrl , setCustomBaseUrl ] = useState < string | undefined > ( ( ) => {
8888 // Try to get from props first, then localStorage
8989 if ( baseUrl ) return baseUrl ;
@@ -125,18 +125,18 @@ export const AddTemplate = ({ environmentId, baseUrl }: Props) => {
125125 } ,
126126 ) ;
127127
128- const { data : favoriteIds = [ ] , isLoading : isLoadingFavorites } =
128+ const { data : bookmarkIds = [ ] , isLoading : isLoadingBookmarks } =
129129 api . user . getBookmarkedTemplates . useQuery ( undefined , {
130130 enabled : open ,
131131 } ) ;
132132
133133 const utils = api . useUtils ( ) ;
134134
135- const { mutateAsync : toggleFavorite } =
135+ const { mutateAsync : toggleBookmark } =
136136 api . user . toggleTemplateBookmark . useMutation ( {
137137 onMutate : async ( { templateId } ) => {
138138 await utils . user . getBookmarkedTemplates . cancel ( ) ;
139- const previousFavorites = utils . user . getBookmarkedTemplates . getData ( ) ;
139+ const previousBookmarks = utils . user . getBookmarkedTemplates . getData ( ) ;
140140
141141 utils . user . getBookmarkedTemplates . setData ( undefined , ( old = [ ] ) => {
142142 if ( old . includes ( templateId ) ) {
@@ -145,20 +145,20 @@ export const AddTemplate = ({ environmentId, baseUrl }: Props) => {
145145 return [ ...old , templateId ] ;
146146 } ) ;
147147
148- return { previousFavorites } ;
148+ return { previousBookmarks } ;
149149 } ,
150150 onError : ( err , variables , context ) => {
151- if ( context ?. previousFavorites ) {
151+ if ( context ?. previousBookmarks ) {
152152 utils . user . getBookmarkedTemplates . setData (
153153 undefined ,
154- context . previousFavorites ,
154+ context . previousBookmarks ,
155155 ) ;
156156 }
157- toast . error ( "Failed to update favorite " ) ;
157+ toast . error ( "Failed to update bookmark " ) ;
158158 } ,
159159 onSuccess : ( data ) => {
160160 toast . success (
161- data . isBookmarked ? "Added to favorites " : "Removed from favorites " ,
161+ data . isBookmarked ? "Added to bookmarks " : "Removed from bookmarks " ,
162162 ) ;
163163 } ,
164164 } ) ;
@@ -176,9 +176,9 @@ export const AddTemplate = ({ environmentId, baseUrl }: Props) => {
176176 query === "" ||
177177 template . name . toLowerCase ( ) . includes ( query . toLowerCase ( ) ) ||
178178 template . description . toLowerCase ( ) . includes ( query . toLowerCase ( ) ) ;
179- const matchesFavorites =
180- ! showFavoritesOnly || favoriteIds . includes ( template . id ) ;
181- return matchesTags && matchesQuery && matchesFavorites ;
179+ const matchesBookmarks =
180+ ! showBookmarksOnly || bookmarkIds . includes ( template . id ) ;
181+ return matchesTags && matchesQuery && matchesBookmarks ;
182182 } ) || [ ] ;
183183
184184 const hasServers = servers && servers . length > 0 ;
@@ -187,12 +187,12 @@ export const AddTemplate = ({ environmentId, baseUrl }: Props) => {
187187 // Self-hosted: show only if there are remote servers (Dokploy is default, hide if no remote servers)
188188 const shouldShowServerDropdown = hasServers ;
189189
190- const handleToggleFavorite = async (
190+ const handleToggleBookmark = async (
191191 e : React . MouseEvent ,
192192 templateId : string ,
193193 ) => {
194194 e . stopPropagation ( ) ;
195- await toggleFavorite ( { templateId } ) ;
195+ await toggleBookmark ( { templateId } ) ;
196196 } ;
197197
198198 return (
@@ -293,16 +293,16 @@ export const AddTemplate = ({ environmentId, baseUrl }: Props) => {
293293 </ PopoverContent >
294294 </ Popover >
295295 < Button
296- variant = { showFavoritesOnly ? "default" : "outline" }
296+ variant = { showBookmarksOnly ? "default" : "outline" }
297297 size = "icon"
298- onClick = { ( ) => setShowFavoritesOnly ( ! showFavoritesOnly ) }
298+ onClick = { ( ) => setShowBookmarksOnly ( ! showBookmarksOnly ) }
299299 className = "h-9 w-9 flex-shrink-0"
300- disabled = { isLoadingFavorites }
300+ disabled = { isLoadingBookmarks }
301301 >
302302 < Bookmark
303303 className = { cn (
304304 "size-4" ,
305- showFavoritesOnly && "fill-current" ,
305+ showBookmarksOnly && "fill-current" ,
306306 ) }
307307 />
308308 </ Button >
@@ -365,14 +365,14 @@ export const AddTemplate = ({ environmentId, baseUrl }: Props) => {
365365 < div className = "flex flex-col justify-center items-center w-full gap-2 min-h-[50vh]" >
366366 < SearchIcon className = "text-muted-foreground size-6" />
367367 < div className = "text-xl font-medium text-muted-foreground" >
368- { showFavoritesOnly
369- ? "No favorite templates found"
368+ { showBookmarksOnly
369+ ? "No bookmarked templates found"
370370 : "No templates found" }
371371 </ div >
372- { showFavoritesOnly && (
372+ { showBookmarksOnly && (
373373 < p className = "text-sm text-muted-foreground" >
374374 Click the bookmark icon on templates to add them to
375- favorites
375+ bookmarks
376376 </ p >
377377 ) }
378378 </ div >
@@ -399,12 +399,12 @@ export const AddTemplate = ({ environmentId, baseUrl }: Props) => {
399399 variant = "ghost"
400400 size = "icon"
401401 className = "h-8 w-8 bg-background/80 backdrop-blur-sm hover:bg-background"
402- onClick = { ( e ) => handleToggleFavorite ( e , template . id ) }
402+ onClick = { ( e ) => handleToggleBookmark ( e , template . id ) }
403403 >
404404 < Bookmark
405405 className = { cn (
406406 "size-4" ,
407- favoriteIds . includes ( template . id ) &&
407+ bookmarkIds . includes ( template . id ) &&
408408 "fill-yellow-400 text-yellow-400" ,
409409 ) }
410410 />
0 commit comments