mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-12-23 19:00:15 +03:00
9 lines
254 B
JavaScript
9 lines
254 B
JavaScript
import { useEffect } from 'preact/hooks';
|
|
|
|
const { VITE_CLIENT_NAME: CLIENT_NAME } = import.meta.env;
|
|
|
|
export default function useTitle(title) {
|
|
useEffect(() => {
|
|
document.title = title ? `${title} / ${CLIENT_NAME}` : CLIENT_NAME;
|
|
}, [title]);
|
|
}
|