committed by
GitHub
11 changed files with 357 additions and 46 deletions
@ -0,0 +1,48 @@ |
|||
name: Code Formatting |
|||
|
|||
on: |
|||
pull_request: |
|||
branches: [ main, master ] |
|||
workflow_dispatch: |
|||
|
|||
jobs: |
|||
format: |
|||
runs-on: ubuntu-latest |
|||
|
|||
permissions: |
|||
contents: write |
|||
pull-requests: write |
|||
|
|||
steps: |
|||
- name: Checkout repository |
|||
uses: actions/checkout@v4 |
|||
with: |
|||
ref: ${{ github.head_ref }} |
|||
fetch-depth: 0 |
|||
token: ${{ secrets.GITHUB_TOKEN }} |
|||
|
|||
- name: Setup Node.js |
|||
uses: actions/setup-node@v4 |
|||
with: |
|||
node-version: '20' |
|||
|
|||
- name: Install Biome |
|||
run: npm install --global @biomejs/biome |
|||
|
|||
- name: Format with Biome |
|||
run: biome format --write . |
|||
|
|||
- name: Check for changes |
|||
id: git-check |
|||
run: | |
|||
git diff --quiet || echo "changes=true" >> $GITHUB_OUTPUT |
|||
|
|||
- name: Commit and push changes |
|||
if: steps.git-check.outputs.changes == 'true' |
|||
run: | |
|||
git config --global user.email "github-actions[bot]@users.noreply.github.com" |
|||
git config --global user.name "github-actions[bot]" |
|||
|
|||
git add -A |
|||
git commit -m "chore: format code" |
|||
git push |
|||
@ -0,0 +1,104 @@ |
|||
import { cn } from "@app/core/utils/cn"; |
|||
|
|||
interface SpinnerProps extends React.HTMLAttributes<HTMLDivElement> { |
|||
size?: "sm" | "md" | "lg"; |
|||
} |
|||
|
|||
const sizeClasses = { |
|||
sm: "h-4 w-4", |
|||
md: "h-8 w-8", |
|||
lg: "h-12 w-12", |
|||
}; |
|||
|
|||
export function Spinner({ className, size = "md", ...props }: SpinnerProps) { |
|||
return ( |
|||
<div |
|||
aria-label="Loading..." |
|||
className={cn( |
|||
"flex items-center justify-center fade-in-50 fade-out-50", |
|||
className, |
|||
)} |
|||
{...props} |
|||
> |
|||
<svg |
|||
className={cn("animate-spin-slow stroke-current", sizeClasses[size])} |
|||
role="img" |
|||
aria-label="Loading spinner" |
|||
viewBox="0 0 256 256" |
|||
> |
|||
<line |
|||
x1="128" |
|||
y1="32" |
|||
x2="128" |
|||
y2="64" |
|||
strokeLinecap="round" |
|||
strokeLinejoin="round" |
|||
strokeWidth="24" |
|||
/> |
|||
<line |
|||
x1="195.9" |
|||
y1="60.1" |
|||
x2="173.3" |
|||
y2="82.7" |
|||
strokeLinecap="round" |
|||
strokeLinejoin="round" |
|||
strokeWidth="24" |
|||
/> |
|||
<line |
|||
x1="224" |
|||
y1="128" |
|||
x2="192" |
|||
y2="128" |
|||
strokeLinecap="round" |
|||
strokeLinejoin="round" |
|||
strokeWidth="24" |
|||
/> |
|||
<line |
|||
x1="195.9" |
|||
y1="195.9" |
|||
x2="173.3" |
|||
y2="173.3" |
|||
strokeLinecap="round" |
|||
strokeLinejoin="round" |
|||
strokeWidth="24" |
|||
/> |
|||
<line |
|||
x1="128" |
|||
y1="224" |
|||
x2="128" |
|||
y2="192" |
|||
strokeLinecap="round" |
|||
strokeLinejoin="round" |
|||
strokeWidth="24" |
|||
/> |
|||
<line |
|||
x1="60.1" |
|||
y1="195.9" |
|||
x2="82.7" |
|||
y2="173.3" |
|||
strokeLinecap="round" |
|||
strokeLinejoin="round" |
|||
strokeWidth="24" |
|||
/> |
|||
<line |
|||
x1="32" |
|||
y1="128" |
|||
x2="64" |
|||
y2="128" |
|||
strokeLinecap="round" |
|||
strokeLinejoin="round" |
|||
strokeWidth="24" |
|||
/> |
|||
<line |
|||
x1="60.1" |
|||
y1="60.1" |
|||
x2="82.7" |
|||
y2="82.7" |
|||
strokeLinecap="round" |
|||
strokeLinejoin="round" |
|||
strokeWidth="24" |
|||
/> |
|||
</svg> |
|||
</div> |
|||
); |
|||
} |
|||
Loading…
Reference in new issue