@@ -31,16 +31,18 @@ const ModelCatalog = ({ models }: { models: WorkersAIModelsSchema[] }) => {
3131 // First check if either model is pinned
3232 const isPinnedA = pinnedModelNames . includes ( a . name ) ;
3333 const isPinnedB = pinnedModelNames . includes ( b . name ) ;
34-
34+
3535 // If pinned status differs, prioritize pinned models
3636 if ( isPinnedA && ! isPinnedB ) return - 1 ;
3737 if ( ! isPinnedA && isPinnedB ) return 1 ;
38-
38+
3939 // If both are pinned, sort by position in pinnedModelNames array (for manual ordering)
4040 if ( isPinnedA && isPinnedB ) {
41- return pinnedModelNames . indexOf ( a . name ) - pinnedModelNames . indexOf ( b . name ) ;
41+ return (
42+ pinnedModelNames . indexOf ( a . name ) - pinnedModelNames . indexOf ( b . name )
43+ ) ;
4244 }
43-
45+
4446 // If neither is pinned, sort by created_at date (newest first)
4547 const dateA = a . created_at ? new Date ( a . created_at ) : new Date ( 0 ) ;
4648 const dateB = b . created_at ? new Date ( b . created_at ) : new Date ( 0 ) ;
@@ -271,11 +273,13 @@ const ModelCatalog = ({ models }: { models: WorkersAIModelsSchema[] }) => {
271273 return (
272274 < a
273275 key = { model . model . id }
274- className = "mb-3 block w-full self-start rounded-md border border-solid border-gray-200 p-3 !text-inherit no-underline hover:bg-gray-50 dark:border-gray-700 dark:hover:bg-gray-800 lg:w-[48%] relative "
276+ className = "relative mb-3 block w-full self-start rounded-md border border-solid border-gray-200 p-3 !text-inherit no-underline hover:bg-gray-50 dark:border-gray-700 dark:hover:bg-gray-800 lg:w-[48%]"
275277 href = { `/workers-ai/models/${ model . model_display_name } ` }
276278 >
277279 { isPinned && (
278- < span className = "absolute top-1 right-2" title = "Pinned model" > 📌</ span >
280+ < span className = "absolute right-2 top-1" title = "Pinned model" >
281+ 📌
282+ </ span >
279283 ) }
280284 < div className = "-mb-1 flex items-center" >
281285 { authorInfo ?. logo ? (
@@ -311,4 +315,4 @@ const ModelCatalog = ({ models }: { models: WorkersAIModelsSchema[] }) => {
311315 ) ;
312316} ;
313317
314- export default ModelCatalog ;
318+ export default ModelCatalog ;
0 commit comments