Refactor code structure for improved readability and maintainability

This commit is contained in:
Felipe Coutinho
2025-11-17 16:17:58 -03:00
parent 3ca495384c
commit 71e083fd49
6 changed files with 404 additions and 422 deletions

View File

@@ -34,21 +34,16 @@ export const PROVIDERS = {
*/ */
export const AVAILABLE_MODELS = [ export const AVAILABLE_MODELS = [
// OpenAI Models (5) // OpenAI Models (5)
{ id: "gpt-5.1", name: "GPT-5.1 ", provider: "openai" as const },
{ id: "gpt-5.1-chat", name: "GPT-5.1 Chat", provider: "openai" as const },
{ id: "gpt-5", name: "GPT-5", provider: "openai" as const }, { id: "gpt-5", name: "GPT-5", provider: "openai" as const },
{ id: "gpt-5-mini", name: "GPT-5 Mini", provider: "openai" as const }, { id: "gpt-5-mini", name: "GPT-5 Mini", provider: "openai" as const },
{ id: "gpt-5-nano", name: "GPT-5 Nano", provider: "openai" as const }, { id: "gpt-5-nano", name: "GPT-5 Nano", provider: "openai" as const },
{ id: "gpt-4.1", name: "GPT-4.1", provider: "openai" as const },
{ id: "gpt-4o", name: "GPT-4o (Omni)", provider: "openai" as const },
// Anthropic Models (5) // Anthropic Models (5)
{ {
id: "claude-3.7-sonnet", id: "claude-4.5-haiku",
name: "Claude 3.7 Sonnet", name: "Claude 4.5 Haiku",
provider: "anthropic" as const,
},
{
id: "claude-4-opus",
name: "Claude 4 Opus",
provider: "anthropic" as const, provider: "anthropic" as const,
}, },
{ {
@@ -57,13 +52,8 @@ export const AVAILABLE_MODELS = [
provider: "anthropic" as const, provider: "anthropic" as const,
}, },
{ {
id: "claude-4.5-haiku", id: "claude-opus-4.1",
name: "Claude 4.5 Haiku", name: "Claude 4.1 Opus",
provider: "anthropic" as const,
},
{
id: "claude-3.5-sonnet-20240620",
name: "Claude 3.5 Sonnet (2024-06-20)",
provider: "anthropic" as const, provider: "anthropic" as const,
}, },
@@ -80,10 +70,7 @@ export const AVAILABLE_MODELS = [
}, },
] as const; ] as const;
/** export const DEFAULT_MODEL = "gpt-5.1";
* Modelo padrão
*/
export const DEFAULT_MODEL = "gpt-5";
export const DEFAULT_PROVIDER = "openai"; export const DEFAULT_PROVIDER = "openai";
/** /**

View File

@@ -654,7 +654,7 @@ export default async function Page() {
<ul className="space-y-3 text-sm text-muted-foreground"> <ul className="space-y-3 text-sm text-muted-foreground">
<li> <li>
<Link <Link
href="https://github.com/felipegcoutinho/opensheets" href="https://github.com/felipegcoutinho/opensheets-app"
target="_blank" target="_blank"
className="hover:text-foreground transition-colors flex items-center gap-2" className="hover:text-foreground transition-colors flex items-center gap-2"
> >
@@ -664,7 +664,7 @@ export default async function Page() {
</li> </li>
<li> <li>
<Link <Link
href="https://github.com/felipegcoutinho/opensheets#readme" href="https://github.com/felipegcoutinho/opensheets-app#readme"
target="_blank" target="_blank"
className="hover:text-foreground transition-colors" className="hover:text-foreground transition-colors"
> >
@@ -673,7 +673,7 @@ export default async function Page() {
</li> </li>
<li> <li>
<Link <Link
href="https://github.com/felipegcoutinho/opensheets/issues" href="https://github.com/felipegcoutinho/opensheets-app/issues"
target="_blank" target="_blank"
className="hover:text-foreground transition-colors" className="hover:text-foreground transition-colors"
> >

View File

@@ -1,9 +1,3 @@
/**
* Category constants and types
*
* Consolidated from /lib/categories.ts
*/
export const CATEGORY_TYPES = ["receita", "despesa"] as const; export const CATEGORY_TYPES = ["receita", "despesa"] as const;
export type CategoryType = (typeof CATEGORY_TYPES)[number]; export type CategoryType = (typeof CATEGORY_TYPES)[number];

View File

@@ -39,6 +39,7 @@ export const CATEGORY_ICON_OPTIONS: CategoryIconOption[] = [
{ label: "Café", value: "RiCupLine" }, { label: "Café", value: "RiCupLine" },
{ label: "Bebida", value: "RiDrinksFill" }, { label: "Bebida", value: "RiDrinksFill" },
{ label: "Pizza", value: "RiCake3Line" }, { label: "Pizza", value: "RiCake3Line" },
{ label: "Cerveja", value: "RiBeerLine" },
// Transporte // Transporte
{ label: "Ônibus", value: "RiBusLine" }, { label: "Ônibus", value: "RiBusLine" },

View File

@@ -26,9 +26,9 @@
}, },
"dependencies": { "dependencies": {
"@ai-sdk/anthropic": "^2.0.44", "@ai-sdk/anthropic": "^2.0.44",
"@ai-sdk/google": "^2.0.31", "@ai-sdk/google": "^2.0.34",
"@ai-sdk/openai": "^2.0.66", "@ai-sdk/openai": "^2.0.68",
"@openrouter/ai-sdk-provider": "^1.2.2", "@openrouter/ai-sdk-provider": "^1.2.3",
"@radix-ui/react-alert-dialog": "1.1.15", "@radix-ui/react-alert-dialog": "1.1.15",
"@radix-ui/react-avatar": "1.1.11", "@radix-ui/react-avatar": "1.1.11",
"@radix-ui/react-checkbox": "1.3.3", "@radix-ui/react-checkbox": "1.3.3",
@@ -58,7 +58,7 @@
"cmdk": "^1.1.1", "cmdk": "^1.1.1",
"date-fns": "^4.1.0", "date-fns": "^4.1.0",
"drizzle-orm": "0.44.7", "drizzle-orm": "0.44.7",
"lucide-react": "0.553.0", "lucide-react": "0.554.0",
"motion": "^12.23.24", "motion": "^12.23.24",
"next": "16.0.3", "next": "16.0.3",
"next-themes": "0.4.6", "next-themes": "0.4.6",
@@ -76,7 +76,7 @@
"devDependencies": { "devDependencies": {
"@tailwindcss/postcss": "4.1.17", "@tailwindcss/postcss": "4.1.17",
"@types/node": "24.10.1", "@types/node": "24.10.1",
"@types/react": "19.2.4", "@types/react": "19.2.5",
"@types/react-dom": "19.2.3", "@types/react-dom": "19.2.3",
"depcheck": "^1.4.7", "depcheck": "^1.4.7",
"drizzle-kit": "0.31.7", "drizzle-kit": "0.31.7",

776
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff