chore: format code

This commit is contained in:
Ayo Ayco 2024-12-26 01:08:20 +01:00
parent 23af739ee4
commit 92fe3d8c0a
5 changed files with 21 additions and 21 deletions

View file

@ -1,4 +1,4 @@
import { defineConfig } from 'astro/config'; import { defineConfig } from 'astro/config'
// https://astro.build/config // https://astro.build/config
export default defineConfig({}); export default defineConfig({})

View file

@ -1,5 +1,5 @@
--- ---
import GithubStats from '../../../'; import GithubStats from '../../../'
--- ---
<html lang="en"> <html lang="en">

View file

@ -1,3 +1,3 @@
{ {
"extends": "astro/tsconfigs/strictest" "extends": "astro/tsconfigs/strictest"
} }

View file

@ -1,3 +1,3 @@
import GithubStats from './src/GithubStats.astro'; import GithubStats from './src/GithubStats.astro'
export default GithubStats; export default GithubStats
export * from './src/GithubStats.astro'; export * from './src/GithubStats.astro'

View file

@ -1,28 +1,28 @@
--- ---
export interface Props { export interface Props {
username: string; username: string
topLanguages?: boolean; topLanguages?: boolean
repo?: string; repo?: string
showIcons?: boolean; showIcons?: boolean
altText?: string; altText?: string
} }
const { username, repo, topLanguages, showIcons, altText } = Astro.props; const { username, repo, topLanguages, showIcons, altText } = Astro.props
const baseUrl = 'https://github-readme-stats.vercel.app/api/'; const baseUrl = 'https://github-readme-stats.vercel.app/api/'
let url = `${baseUrl}?username=${username}&show_icons=${!!showIcons}`; let url = `${baseUrl}?username=${username}&show_icons=${!!showIcons}`
let alt = `GitHub stats for account: ${username}`; let alt = `GitHub stats for account: ${username}`
if (repo) { if (repo) {
url = `${baseUrl}/pin/?username=${username}&repo=${repo}`; url = `${baseUrl}/pin/?username=${username}&repo=${repo}`
alt = `GitHub stats for repository: ${username}/${repo}`; alt = `GitHub stats for repository: ${username}/${repo}`
} }
if (topLanguages) { if (topLanguages) {
url = `${baseUrl}top-langs?username=${username}`; url = `${baseUrl}top-langs?username=${username}`
alt = `GitHub top languages for account: ${username}`; alt = `GitHub top languages for account: ${username}`
} }
alt = altText || alt; alt = altText || alt
--- ---
<img src={url} alt={alt} /> <img src={url} alt={alt} />