mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
* feat(generic): add generic resource tab, refactor home structure, and UI polish * reverted hardcoded ff * fix build * styling consistency * styling * fix(auth): extract shared auth button class and align SSO primary style - Extract AUTH_SUBMIT_BTN constant to (auth)/components/auth-button-classes.ts, replacing 10 copy-pasted identical className strings across 7 files - Update SSOLoginButton primary variant to use AUTH_SUBMIT_BTN instead of hardcoded purple gradient, making it consistent with all other auth form submit buttons - Fix missing isEphemeralResource import in lib/copilot/resources.ts (was re-exported but not available in local scope) * fix(auth): replace inline button class in chat auth components with AUTH_SUBMIT_BTN * fix send button hover state
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
|
|
}
|
|
}
|