mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
* refactor: moved home into landing * improvement(landing): blog dropdown and content updates * improvement: ui/ux * improvement: footer, enterprise, templates,etc. * improvement: blog * fix: reset feature flags to dynamic values * fix: remove unused mobileLabel reference in features tabs * improvement(auth): match oauth button styling with inputs and navbar login * fix: resolve TypeScript errors in landing components - Add explicit FeatureTab interface type for FEATURE_TABS with optional mobileLabel property - Remove reference to undefined MOBILE_STEPS in landing-preview (mobile uses static display anyway) Co-authored-by: Emir Karabeg <emir-karabeg@users.noreply.github.com> * fix(demo-request): remove region from schema and route, delete unused PostGrid --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Emir Karabeg <emir-karabeg@users.noreply.github.com>
27 lines
639 B
TypeScript
27 lines
639 B
TypeScript
import { createLogger } from '@sim/logger'
|
|
|
|
const DEFAULT_STARS = '19.4k'
|
|
|
|
const logger = createLogger('GitHubStars')
|
|
|
|
export async function getFormattedGitHubStars(): Promise<string> {
|
|
try {
|
|
const response = await fetch('/api/stars', {
|
|
headers: {
|
|
'Cache-Control': 'max-age=3600', // Cache for 1 hour
|
|
},
|
|
})
|
|
|
|
if (!response.ok) {
|
|
logger.warn('Failed to fetch GitHub stars from API')
|
|
return DEFAULT_STARS
|
|
}
|
|
|
|
const data = await response.json()
|
|
return data.stars || DEFAULT_STARS
|
|
} catch (error) {
|
|
logger.warn('Error fetching GitHub stars:', error)
|
|
return DEFAULT_STARS
|
|
}
|
|
}
|