forked from sheepzh/time-tracker-4-browser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAlert.tsx
More file actions
26 lines (23 loc) · 873 Bytes
/
Alert.tsx
File metadata and controls
26 lines (23 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { getUrl } from "@api/chrome/runtime"
import { t } from "@cs/locale"
import { useRequest } from "@hooks/useRequest"
import optionHolder from "@service/components/option-holder"
import { defineComponent } from "vue"
const ICON_URL = getUrl('static/images/icon.png')
const _default = defineComponent(() => {
const defaultPrompt = t(msg => msg.modal.defaultPrompt)
const { data: prompt } = useRequest(async () => {
const option = await optionHolder.get()
return option?.limitPrompt || defaultPrompt
}, { defaultValue: defaultPrompt })
return () => (
<div class='alert-container'>
<h2 class='name-line'>
<img src={ICON_URL} />
<span> {t(msg => msg.meta.name)?.toUpperCase()}</span>
</h2>
<h1>{prompt.value}</h1>
</div>
)
})
export default _default