chore: add Biome for formatting and linting (#116)

- Add Biome as formatter and linter (replaces Prettier)
- Configure Husky + lint-staged for pre-commit hooks
- Add VS Code settings for format on save
- Ignore components/ui/ (shadcn generated code)
- Remove semicolons, use 4-space indent
- Reformat all files to new style
This commit is contained in:
Dayuan Jiang
2025-12-06 12:46:40 +09:00
committed by GitHub
parent 215a101f54
commit 150eb1ff63
41 changed files with 3992 additions and 2401 deletions

View File

@@ -1,12 +1,12 @@
"use client";
"use client"
import { Zap, Cloud, GitBranch, Palette } from "lucide-react";
import { Cloud, GitBranch, Palette, Zap } from "lucide-react"
interface ExampleCardProps {
icon: React.ReactNode;
title: string;
description: string;
onClick: () => void;
icon: React.ReactNode
title: string
description: string
onClick: () => void
}
function ExampleCard({ icon, title, description, onClick }: ExampleCardProps) {
@@ -29,43 +29,43 @@ function ExampleCard({ icon, title, description, onClick }: ExampleCardProps) {
</div>
</div>
</button>
);
)
}
export default function ExamplePanel({
setInput,
setFiles,
}: {
setInput: (input: string) => void;
setFiles: (files: File[]) => void;
setInput: (input: string) => void
setFiles: (files: File[]) => void
}) {
const handleReplicateFlowchart = async () => {
setInput("Replicate this flowchart.");
setInput("Replicate this flowchart.")
try {
const response = await fetch("/example.png");
const blob = await response.blob();
const file = new File([blob], "example.png", { type: "image/png" });
setFiles([file]);
const response = await fetch("/example.png")
const blob = await response.blob()
const file = new File([blob], "example.png", { type: "image/png" })
setFiles([file])
} catch (error) {
console.error("Error loading example image:", error);
console.error("Error loading example image:", error)
}
};
}
const handleReplicateArchitecture = async () => {
setInput("Replicate this in aws style");
setInput("Replicate this in aws style")
try {
const response = await fetch("/architecture.png");
const blob = await response.blob();
const response = await fetch("/architecture.png")
const blob = await response.blob()
const file = new File([blob], "architecture.png", {
type: "image/png",
});
setFiles([file]);
})
setFiles([file])
} catch (error) {
console.error("Error loading architecture image:", error);
console.error("Error loading architecture image:", error)
}
};
}
return (
<div className="py-6 px-2 animate-fade-in">
@@ -75,7 +75,8 @@ export default function ExamplePanel({
Create diagrams with AI
</h2>
<p className="text-sm text-muted-foreground max-w-xs mx-auto">
Describe what you want to create or upload an image to replicate
Describe what you want to create or upload an image to
replicate
</p>
</div>
@@ -91,7 +92,9 @@ export default function ExamplePanel({
title="Animated Diagram"
description="Draw a transformer architecture with animated connectors"
onClick={() => {
setInput("Give me a **animated connector** diagram of transformer's architecture")
setInput(
"Give me a **animated connector** diagram of transformer's architecture",
)
setFiles([])
}}
/>
@@ -126,5 +129,5 @@ export default function ExamplePanel({
</p>
</div>
</div>
);
)
}