feat: zap (#107)

This commit is contained in:
Cody Tseng 2025-03-01 23:52:05 +08:00 committed by GitHub
parent 407a6fb802
commit 249593d547
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
72 changed files with 2582 additions and 818 deletions

View file

@ -0,0 +1,27 @@
import { Input } from '@/components/ui/input'
import { Label } from '@/components/ui/label'
import { useZap } from '@/providers/ZapProvider'
import { useState } from 'react'
import { useTranslation } from 'react-i18next'
export default function DefaultZapCommentInput() {
const { t } = useTranslation()
const { defaultZapComment, updateDefaultComment } = useZap()
const [defaultZapCommentInput, setDefaultZapCommentInput] = useState(defaultZapComment)
return (
<div className="w-full space-y-1">
<Label htmlFor="default-zap-comment-input">{t('Default zap comment')}</Label>
<div className="flex w-full items-center gap-2">
<Input
id="default-zap-comment-input"
value={defaultZapCommentInput}
onChange={(e) => setDefaultZapCommentInput(e.target.value)}
onBlur={() => {
updateDefaultComment(defaultZapCommentInput)
}}
/>
</div>
</div>
)
}