Files
Portfolio/src/app/core/content/content.service.ts
Antonio Ledebuhr b95dbd8e1a Transcribe the approved service-led content contracts and bilingual copy.
The site now has one services page, six public cases, and no MySpa or calendar-scaffold strings.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-27 00:41:13 +02:00

67 lines
2.0 KiB
TypeScript

import { computed, inject, Injectable, type Signal } from '@angular/core';
import { LocaleService } from '../i18n/locale.service';
import { type RouteId } from '../routing/route-ids';
import {
CASE_STUDY_IDS,
type CaseStudyCopy,
type CaseStudyId,
type ContactPageCopy,
type HomePageCopy,
type LegalPageCopy,
type PageCopy,
type PitchPageCopy,
type ProjectsPageCopy,
type ServicesPageCopy,
type StackPageCopy,
} from './content.contracts';
import { SITE_CONTENT } from './content.token';
@Injectable({ providedIn: 'root' })
export class ContentService {
private readonly localeService = inject(LocaleService);
private readonly content = inject(SITE_CONTENT);
page(routeId: RouteId): Signal<PageCopy> {
return computed(() => this.content[this.localeService.locale()].pages[routeId]);
}
home(): Signal<HomePageCopy> {
return computed(() => this.content[this.localeService.locale()].home);
}
pitch(): Signal<PitchPageCopy> {
return computed(() => this.content[this.localeService.locale()].pitch);
}
services(): Signal<ServicesPageCopy> {
return computed(() => this.content[this.localeService.locale()].services);
}
caseStudy(id: CaseStudyId): Signal<CaseStudyCopy> {
return computed(() => this.content[this.localeService.locale()].cases[id]);
}
cases(): Signal<readonly CaseStudyCopy[]> {
return computed(() => {
const cases = this.content[this.localeService.locale()].cases;
return CASE_STUDY_IDS.map((id) => cases[id]);
});
}
contact(): Signal<ContactPageCopy> {
return computed(() => this.content[this.localeService.locale()].contact);
}
projects(): Signal<ProjectsPageCopy> {
return computed(() => this.content[this.localeService.locale()].projects);
}
stack(): Signal<StackPageCopy> {
return computed(() => this.content[this.localeService.locale()].stack);
}
legal(id: 'imprint' | 'privacy'): Signal<LegalPageCopy> {
return computed(() => this.content[this.localeService.locale()].legal[id]);
}
}