Build fixes: offline-safe fonts, Next.js API route type updates, TS strict errors resolved, MUI import cleanup, chat markdown wrapper, Azure OpenAI typing, caching key + chapter API id types, and misc error-logging typings.
This commit is contained in:
36
lib/fonts.ts
36
lib/fonts.ts
@@ -1,15 +1,25 @@
|
||||
import { Merriweather, Lato } from 'next/font/google'
|
||||
// Offline-safe font shim for builds without network access.
|
||||
// Provides the minimal shape used by the app: `.style.fontFamily` and `.variable`.
|
||||
|
||||
export const merriweather = Merriweather({
|
||||
subsets: ['latin'],
|
||||
weight: ['300', '400', '700', '900'],
|
||||
variable: '--font-merriweather',
|
||||
display: 'swap',
|
||||
})
|
||||
type FontShim = {
|
||||
style: { fontFamily: string }
|
||||
variable: string
|
||||
}
|
||||
|
||||
export const lato = Lato({
|
||||
subsets: ['latin'],
|
||||
weight: ['300', '400', '700', '900'],
|
||||
variable: '--font-lato',
|
||||
display: 'swap',
|
||||
})
|
||||
export const merriweather: FontShim = {
|
||||
// Prefer Merriweather if available on the system, otherwise common serif fallbacks
|
||||
style: {
|
||||
fontFamily: 'Merriweather, Georgia, "Times New Roman", Times, serif',
|
||||
},
|
||||
// Not using next/font CSS variable when offline
|
||||
variable: '',
|
||||
}
|
||||
|
||||
export const lato: FontShim = {
|
||||
// Prefer Lato if available on the system, otherwise robust system sans fallbacks
|
||||
style: {
|
||||
fontFamily:
|
||||
'Lato, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',
|
||||
},
|
||||
variable: '',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user