diff --git a/modules/customer-invoices/src/common/locales/en.json b/modules/customer-invoices/src/common/locales/en.json index f953e57b..963789b8 100644 --- a/modules/customer-invoices/src/common/locales/en.json +++ b/modules/customer-invoices/src/common/locales/en.json @@ -1,5 +1,12 @@ { - "common": {}, + "common": { + "append_empty_row": "Append row", + "append_empty_row_tooltip": "Append a empty row", + "duplicate_row": "Duplicate", + "insert_row_above": "Insert row above", + "insert_row_below": "Insert row below", + "remove_row": "Remove" + }, "pages": { "title": "Customer invoices", "description": "Manage your customer invoices", @@ -45,6 +52,16 @@ "placeholder": "", "description": "" }, + "issue_date": { + "label": "Date", + "placeholder": "Select a date", + "description": "Invoice issue date" + }, + "operation_date": { + "label": "Operation date", + "placeholder": "Select a date", + "description": "Invoice operation date" + }, "items": { "quantity": { "label": "Quantity", diff --git a/modules/customer-invoices/src/common/locales/es.json b/modules/customer-invoices/src/common/locales/es.json index 79bc9713..a420c33e 100644 --- a/modules/customer-invoices/src/common/locales/es.json +++ b/modules/customer-invoices/src/common/locales/es.json @@ -1,5 +1,12 @@ { - "common": {}, + "common": { + "append_empty_row": "Añadir fila", + "append_empty_row_tooltip": "Añadir una fila vacía", + "duplicate_row": "Duplicar fila", + "insert_row_above": "Insertar fila encima", + "insert_row_below": "Insertar fila debajo", + "remove_row": "Eliminar" + }, "pages": { "title": "Facturas", "description": "Gestiona tus facturas", @@ -45,6 +52,16 @@ "placeholder": "", "description": "" }, + "issue_date": { + "label": "Fecha", + "placeholder": "Seleccionar una fecha", + "description": "Fecha de emisión de la factura" + }, + "operation_date": { + "label": "Intervención", + "placeholder": "Seleccionar una fecha", + "description": "Fecha de intervención de los trabajos" + }, "items": { "quantity": { "label": "Cantidad", diff --git a/modules/customer-invoices/src/web/components/buttons/append-block-row-button.tsx b/modules/customer-invoices/src/web/components/buttons/append-block-row-button.tsx deleted file mode 100644 index e73ef1ff..00000000 --- a/modules/customer-invoices/src/web/components/buttons/append-block-row-button.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { Button } from "@repo/shadcn-ui/components"; -import { t } from "i18next"; -import { PackagePlusIcon } from "lucide-react"; -import { JSX, forwardRef } from "react"; - -export interface AppendBlockRowButtonProps extends React.ComponentProps { - label?: string; -} - -export const AppendBlockRowButton = forwardRef( - ( - { label = t("common.append_block"), className, ...props }: AppendBlockRowButtonProps, - ref - ): JSX.Element => ( - - ) -); - -AppendBlockRowButton.displayName = "AppendBlockRowButton"; diff --git a/modules/customer-invoices/src/web/components/buttons/append-catalog-article-row-button.tsx b/modules/customer-invoices/src/web/components/buttons/append-catalog-article-row-button.tsx deleted file mode 100644 index 763016ff..00000000 --- a/modules/customer-invoices/src/web/components/buttons/append-catalog-article-row-button.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import { Button } from "@repo/shadcn-ui/components"; -import { t } from "i18next"; -import { PackagePlusIcon } from "lucide-react"; -import { JSX, forwardRef } from "react"; - -export interface AppendCatalogArticleRowButtonProps extends React.ComponentProps { - label?: string; -} - -export const AppendCatalogArticleRowButton = forwardRef< - HTMLButtonElement, - AppendCatalogArticleRowButtonProps ->( - ( - { label = t("common.append_article"), className, ...props }: AppendCatalogArticleRowButtonProps, - ref - ): JSX.Element => ( - - ) -); - -AppendCatalogArticleRowButton.displayName = "AppendCatalogArticleRowButton"; diff --git a/modules/customer-invoices/src/web/components/buttons/append-empty-row-button.tsx b/modules/customer-invoices/src/web/components/buttons/append-empty-row-button.tsx index 1ed526a1..dd71d00b 100644 --- a/modules/customer-invoices/src/web/components/buttons/append-empty-row-button.tsx +++ b/modules/customer-invoices/src/web/components/buttons/append-empty-row-button.tsx @@ -1,7 +1,8 @@ import { Button } from "@repo/shadcn-ui/components"; -import { t } from "i18next"; import { PlusCircleIcon } from "lucide-react"; import { JSX, forwardRef } from "react"; +import { useTranslation } from "react-i18next"; +import { MODULE_NAME } from "../../manifest"; export interface AppendEmptyRowButtonProps extends React.ComponentProps { label?: string; @@ -9,15 +10,17 @@ export interface AppendEmptyRowButtonProps extends React.ComponentProps( - ( - { label = t("common.append_empty_row"), className, ...props }: AppendEmptyRowButtonProps, - ref - ): JSX.Element => ( - - ) + ({ label, className, ...props }: AppendEmptyRowButtonProps, ref): JSX.Element => { + const { t } = useTranslation(MODULE_NAME); + const _label = label || t("common.append_empty_row"); + + return ( + + ); + } ); AppendEmptyRowButton.displayName = "AppendEmptyRowButton"; diff --git a/modules/customer-invoices/src/web/components/buttons/index.ts b/modules/customer-invoices/src/web/components/buttons/index.ts index f09f7446..e5658673 100644 --- a/modules/customer-invoices/src/web/components/buttons/index.ts +++ b/modules/customer-invoices/src/web/components/buttons/index.ts @@ -1,3 +1 @@ -export * from "./append-block-row-button"; -export * from "./append-catalog-article-row-button"; export * from "./append-empty-row-button"; diff --git a/modules/customer-invoices/src/web/components/items/customer-invoice-items-card-editor.tsx b/modules/customer-invoices/src/web/components/items/customer-invoice-items-card-editor.tsx index 3b5f62bc..78fad8fc 100644 --- a/modules/customer-invoices/src/web/components/items/customer-invoice-items-card-editor.tsx +++ b/modules/customer-invoices/src/web/components/items/customer-invoice-items-card-editor.tsx @@ -76,7 +76,7 @@ export const CustomerInvoiceItemsCardEditor = ({ { id: "description" as const, accessorKey: "description", - header: t("customer_invoices.form_fields.description.label"), + header: t("form_fields.items.description.label"), cell: ({ row: { index, original } }) => (