| import type { AppDetailResponse } from '@/models/app' | import type { AppDetailResponse } from '@/models/app' | ||||
| import type { Language } from '@/types/app' | import type { Language } from '@/types/app' | ||||
| import EmojiPicker from '@/app/components/base/emoji-picker' | import EmojiPicker from '@/app/components/base/emoji-picker' | ||||
| import { useToastContext } from '@/app/components/base/toast' | |||||
| import { languages } from '@/i18n/language' | import { languages } from '@/i18n/language' | ||||
| onClose, | onClose, | ||||
| onSave, | onSave, | ||||
| }) => { | }) => { | ||||
| const { notify } = useToastContext() | |||||
| const [isShowMore, setIsShowMore] = useState(false) | const [isShowMore, setIsShowMore] = useState(false) | ||||
| const { icon, icon_background } = appInfo | const { icon, icon_background } = appInfo | ||||
| const { title, description, copyright, privacy_policy, default_language } = appInfo.site | const { title, description, copyright, privacy_policy, default_language } = appInfo.site | ||||
| } | } | ||||
| const onClickSave = async () => { | const onClickSave = async () => { | ||||
| if (!inputInfo.title) { | |||||
| notify({ type: 'error', message: t('app.newApp.nameNotEmpty') }) | |||||
| return | |||||
| } | |||||
| setSaveLoading(true) | setSaveLoading(true) | ||||
| const params = { | const params = { | ||||
| title: inputInfo.title, | title: inputInfo.title, |