diff --git a/src/components/Settings/Overlay.tsx b/src/components/Settings/Overlay.tsx
index a1d7fe7..0ec2703 100644
--- a/src/components/Settings/Overlay.tsx
+++ b/src/components/Settings/Overlay.tsx
@@ -26,6 +26,8 @@ import {
localStoreSchema,
POSITION_TYPE_AGILE,
POSITION_TYPE_QUANTITY,
+ PrintType,
+ printTypeTitles,
PRINT_TYPE_CONFIRMATION,
PRINT_TYPE_INVOICE,
PRINT_TYPE_OFFER,
@@ -876,15 +878,17 @@ const SettingsOverlay: Component = () => {
}}
>
- {([type, label]) => (
+ {(type) => (
)}
diff --git a/src/routes/index.tsx b/src/routes/index.tsx
index 2c4d0da..42be673 100644
--- a/src/routes/index.tsx
+++ b/src/routes/index.tsx
@@ -26,6 +26,7 @@ import {
createStore,
createUiStore,
LocalStoreContext,
+ printTypeTitles,
PRINT_TYPE_CONFIRMATION,
PRINT_TYPE_INVOICE,
PRINT_TYPE_OFFER,
@@ -128,10 +129,11 @@ export default function Home() {
const titleMemo = createMemo(
() =>
(state.positions.length > 0 ? `(${state.positions.length}) ` : "") +
- "Räppli" +
- (state.project.projectNumber.length
- ? ` - ${state.project.projectNumber}`
- : "")
+ "Räppli - " +
+ (state.project.projectNumber.length > 0
+ ? `${state.project.projectNumber} - `
+ : "") +
+ printTypeTitles[uiState.printType]
);
return (
diff --git a/src/stores.ts b/src/stores.ts
index 1ea49ab..b9595da 100644
--- a/src/stores.ts
+++ b/src/stores.ts
@@ -29,13 +29,21 @@ export const PRINT_TYPE_OFFER = "OFFER";
export const PRINT_TYPE_CONFIRMATION = "CONFIRMATION";
export const PRINT_TYPE_INVOICE = "INVOICE";
+export type PrintType =
+ | typeof PRINT_TYPE_OFFER
+ | typeof PRINT_TYPE_CONFIRMATION
+ | typeof PRINT_TYPE_INVOICE;
+
+export const printTypeTitles = {
+ [PRINT_TYPE_OFFER]: "Offerte",
+ [PRINT_TYPE_CONFIRMATION]: "Bestätigung",
+ [PRINT_TYPE_INVOICE]: "Rechnung",
+};
+
export const createUiStore = () =>
createStore_({
lastSaved: 0,
- printType: PRINT_TYPE_INVOICE as
- | typeof PRINT_TYPE_OFFER
- | typeof PRINT_TYPE_CONFIRMATION
- | typeof PRINT_TYPE_INVOICE,
+ printType: PRINT_TYPE_INVOICE as PrintType,
selectedPosition: undefined as undefined | number,
});
export type UiStore = ReturnType;