diff --git a/.claude/templates/detail-page.template.tsx b/.claude/templates/detail-page.template.tsx deleted file mode 100644 index 32acc1b..0000000 --- a/.claude/templates/detail-page.template.tsx +++ /dev/null @@ -1,194 +0,0 @@ -/** - * TEMPLATE: Página de Detalhe - * - * Este arquivo é referência para agentes AI, NÃO é código executável. - * Copie e adapte os padrões abaixo ao criar páginas de detalhe/visualização. - * - * Estrutura: PageContainer + PageHeader(com backLink) + StatusCard + SectionLabels + Info grids - */ - -// ============================================================ -// page.tsx (ViewModel) — rota filha, usa useBreadcrumb -// ============================================================ - -"use client"; - -import { useBreadcrumb } from "@/components/breadcrumb/use-breadcrumb"; -import { useExampleDetailModel } from "./example-detail.model"; -import { ExampleDetailView } from "./example-detail.view"; - -export default function ExampleDetailPage() { - useBreadcrumb({ - title: "Detalhes do Item", - backUrl: "/items", - section: "Itens", - subsection: "Detalhes", - }); - - const model = useExampleDetailModel(); - return ; -} - -// ============================================================ -// example-detail.types.ts -// ============================================================ - -export interface ExampleDetailItem { - id: string; - name: string; - description: string; - status: "active" | "inactive" | "pending"; - createdAt: string; - category: string; - quantity: number; -} - -export interface ExampleDetailViewProps { - item: ExampleDetailItem | null; - isLoading: boolean; - error: Error | null; - onRetry: () => void; -} - -// ============================================================ -// example-detail.model.ts -// ============================================================ - -// import { useParams } from "next/navigation"; -// import useSWR from "swr"; -// import { api } from "@/lib/api"; -// import type { ExampleDetailViewProps } from "./example-detail.types"; -// -// export function useExampleDetailModel(): ExampleDetailViewProps { -// const { id } = useParams(); -// const { data, error, isLoading, mutate } = useSWR( -// `/api/example/${id}`, -// (url: string) => api.get(url).json() -// ); -// -// return { -// item: data ?? null, -// isLoading, -// error: error ?? null, -// onRetry: () => mutate(), -// }; -// } - -// ============================================================ -// example-detail.view.tsx (View) -// ============================================================ - -import { - Package, - Edit, - Info, - Clock, - Tag, - Boxes, -} from "lucide-react"; -import { Button } from "@/components/ui/button"; -import { PageContainer } from "@/components/ui/page-container"; -import { PageHeader } from "@/components/ui/page-header"; -import { StatusCard } from "@/components/ui/status-card"; -import { SectionLabel } from "@/components/ui/section-label"; -import { LoadingState } from "@/components/ui/loading-state"; -import { ErrorState } from "@/components/ui/error-state"; -// import type { ExampleDetailViewProps } from "./example-detail.types"; - -function ExampleDetailView(/* props: ExampleDetailViewProps */) { - // if (isLoading) return ; - // if (error) return ; - // if (!item) return null; - - return ( - - {/* Header com ação de editar */} - - - EDITAR - - } - /> - - {/* Card de status principal */} - -
-
- -
-

Ativo

-

- Criado em 01/01/2025 -

-
-
- - 128 - -
-
- - {/* Seção: Informações Gerais */} - - Informações Gerais - -
-
-

- Nome -

-

Item de Exemplo

-
-
-

- Categoria -

-

Eletrônicos

-
-
-

- Quantidade -

-

- 128 -

-
-
- - {/* Seção: Histórico */} - - Histórico - -
- -
-
-

Atualização de estoque

-

01/01/2025 às 14:30

-
- - +50 - -
-
- -
-
-

Saída de estoque

-

28/12/2024 às 09:15

-
- - -20 - -
-
-
-
- ); -} - -export { ExampleDetailView }; diff --git a/.claude/templates/form-page.template.tsx b/.claude/templates/form-page.template.tsx deleted file mode 100644 index 269bf2b..0000000 --- a/.claude/templates/form-page.template.tsx +++ /dev/null @@ -1,184 +0,0 @@ -/** - * TEMPLATE: Página de Formulário - * - * Este arquivo é referência para agentes AI, NÃO é código executável. - * Copie e adapte os padrões abaixo ao criar páginas de formulário. - * - * Estrutura: PageContainer(fixed-bar) + Form + FormSections em grid + FixedBottomBar - */ - -// ============================================================ -// page.tsx (ViewModel) — rota filha, usa useBreadcrumb -// ============================================================ - -"use client"; - -import { useBreadcrumb } from "@/components/breadcrumb/use-breadcrumb"; -import { useExampleCreateModel } from "./example-create.model"; -import { ExampleCreateView } from "./example-create.view"; - -export default function ExampleCreatePage() { - useBreadcrumb({ - title: "Novo Item", - backUrl: "/items", - section: "Itens", - subsection: "Criar", - }); - - const model = useExampleCreateModel(); - return ; -} - -// ============================================================ -// example-create.types.ts -// ============================================================ - -export interface ExampleCreateViewProps { - onSubmit: (data: ExampleFormData) => void; - isSubmitting: boolean; -} - -export interface ExampleFormData { - name: string; - description: string; - category: string; -} - -// ============================================================ -// example-create.schema.ts -// ============================================================ - -// import { z } from "zod"; -// -// export const exampleCreateSchema = z.object({ -// name: z.string().min(1, "Nome é obrigatório"), -// description: z.string().optional(), -// category: z.string().min(1, "Categoria é obrigatória"), -// }); - -// ============================================================ -// example-create.model.ts -// ============================================================ - -// import { useState } from "react"; -// import { api } from "@/lib/api"; -// import type { ExampleCreateViewProps, ExampleFormData } from "./example-create.types"; -// -// export function useExampleCreateModel(): ExampleCreateViewProps { -// const [isSubmitting, setIsSubmitting] = useState(false); -// -// async function onSubmit(data: ExampleFormData) { -// setIsSubmitting(true); -// try { -// await api.post("/api/example", { json: data }).json(); -// } finally { -// setIsSubmitting(false); -// } -// } -// -// return { onSubmit, isSubmitting }; -// } - -// ============================================================ -// example-create.view.tsx (View) -// ============================================================ - -import { Package, Settings, FileText, Save } from "lucide-react"; -import { Button } from "@/components/ui/button"; -import { Input } from "@/components/ui/input"; -import { Label } from "@/components/ui/label"; -import { Textarea } from "@/components/ui/textarea"; -import { PageContainer } from "@/components/ui/page-container"; -import { PageHeader } from "@/components/ui/page-header"; -import { FormSection } from "@/components/ui/form-section"; -import { FixedBottomBar } from "@/components/ui/fixed-bottom-bar"; -// import type { ExampleCreateViewProps } from "./example-create.types"; - -function ExampleCreateView(/* props: ExampleCreateViewProps */) { - return ( - - - -
- {/* Coluna principal (2/3) */} -
- -
- - -
-
- -