2024-02-14 11:53:44 +07:00
|
|
|
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
2023-07-01 14:03:01 +07:00
|
|
|
import style from "./styles/footer.scss"
|
2023-07-23 07:27:41 +07:00
|
|
|
import { version } from "../../package.json"
|
2024-02-05 11:57:10 +07:00
|
|
|
import { i18n } from "../i18n"
|
2023-07-01 14:03:01 +07:00
|
|
|
|
|
|
|
interface Options {
|
|
|
|
links: Record<string, string>
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ((opts?: Options) => {
|
2024-02-14 11:53:44 +07:00
|
|
|
const Footer: QuartzComponent = ({ displayClass, cfg }: QuartzComponentProps) => {
|
2023-07-01 14:03:01 +07:00
|
|
|
const year = new Date().getFullYear()
|
|
|
|
const links = opts?.links ?? []
|
2023-07-23 07:27:41 +07:00
|
|
|
return (
|
2023-10-02 07:20:55 +07:00
|
|
|
<footer class={`${displayClass ?? ""}`}>
|
2023-07-23 07:27:41 +07:00
|
|
|
<p>
|
2024-02-05 11:57:10 +07:00
|
|
|
{i18n(cfg.locale).components.footer.createdWith}{" "}
|
|
|
|
<a href="https://quartz.jzhao.xyz/">Quartz v{version}</a> © {year}
|
2023-07-23 07:27:41 +07:00
|
|
|
</p>
|
|
|
|
<ul>
|
|
|
|
{Object.entries(links).map(([text, link]) => (
|
|
|
|
<li>
|
|
|
|
<a href={link}>{text}</a>
|
|
|
|
</li>
|
|
|
|
))}
|
|
|
|
</ul>
|
|
|
|
</footer>
|
|
|
|
)
|
2023-07-01 14:03:01 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
Footer.css = style
|
|
|
|
return Footer
|
|
|
|
}) satisfies QuartzComponentConstructor
|