@lobehub/chat
Version:
Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.
17 lines (11 loc) • 442 B
text/typescript
import { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { parseGreetingTime } from './greetingTime';
export const useGreeting = () => {
const { t } = useTranslation('welcome');
const [greeting, setGreeting] = useState<'morning' | 'noon' | 'afternoon' | 'night'>();
useEffect(() => {
setGreeting(parseGreetingTime());
}, []);
return greeting && t(`guide.welcome.${greeting}`);
};