import { GRAMMAR_ATTRIBUTION, GRAMMAR_META } from "#configuration/strings/grammar.strings"; import { GRAMMAR_DESCRIPTION, GRAMMAR_TITLE } from "#configuration/strings/page.strings"; import { GRAMMAR_REPOSITORY, LICENSE_FILE, SITE_URL, pagePath } from "#assets/link.assets"; import { mountTabSwitching, renderTabbedPage } from "#presentation/widgets/tab.widget"; import { COMPANY_OWNER } from "#configuration/strings/company.strings"; import { GRAMMAR_PAGE } from "#core/ids/page.ids"; import { GRAMMAR_TABS } from "#configuration/strings/site.strings"; import { GRAMMAR_TONE } from "#configuration/constants/tab.constants"; import type { PageDefinition } from "#types/page.types"; import type { SchemaEntity } from "#types/schema.types"; import type { TabbedPage } from "#types/tab.types"; import { renderLicensedFooter } from "#presentation/renderers/methodology.renderer"; const GRAMMAR_ENTITY: SchemaEntity = { "@type": "DefinedTerm", creator: { "@type": "Person", name: COMPANY_OWNER }, description: GRAMMAR_DESCRIPTION, license: SITE_URL + LICENSE_FILE, name: GRAMMAR_META.title, sameAs: GRAMMAR_REPOSITORY, termCode: GRAMMAR_TITLE, url: SITE_URL + pagePath(GRAMMAR_PAGE), version: GRAMMAR_META.version, }; const renderGrammarFooter = function renderGrammarFooter(): Element { return renderLicensedFooter(GRAMMAR_ATTRIBUTION); }; const DEFINITION: TabbedPage = { footer: renderGrammarFooter, layout: "chapter", meta: GRAMMAR_META, page: GRAMMAR_PAGE, tabs: GRAMMAR_TABS, tone: GRAMMAR_TONE, }; const renderGrammar = function renderGrammar(): Element { return renderTabbedPage(DEFINITION); }; void mountTabSwitching(DEFINITION); export const PAGE: PageDefinition = { content: { kind: "tabbed", layout: DEFINITION.layout, meta: GRAMMAR_META, tabs: GRAMMAR_TABS }, description: GRAMMAR_DESCRIPTION, entities: [GRAMMAR_ENTITY], id: GRAMMAR_PAGE, render: renderGrammar, title: GRAMMAR_TITLE, };