| 1 | /** |
| 2 | * WxGzhParams - 微信公众号平台参数设置 |
| 3 | * - 独立参数:title(与通用 title 区分,使用 option.wxGzh.title 保存) |
| 4 | */ |
| 5 | import type { ForwardedRef } from 'react' |
| 6 | import type { |
| 7 | IPlatsParamsProps, |
| 8 | IPlatsParamsRef, |
| 9 | } from '@/components/PublishDialog/compoents/PlatParamsSetting/plats/plats.type' |
| 10 | import { forwardRef, memo } from 'react' |
| 11 | import { useTransClient } from '@/app/i18n/client' |
| 12 | import usePlatParamsCommon from '@/components/PublishDialog/compoents/PlatParamsSetting/hooks/usePlatParamsCoomon' |
| 13 | import PubParmasTextarea from '@/components/PublishDialog/compoents/PubParmasTextarea' |
| 14 | import { Input } from '@/components/ui/input' |
| 15 | |
| 16 | const WxGzhParams = memo( |
| 17 | forwardRef( |
| 18 | ( |
| 19 | { pubItem, isMobile }: IPlatsParamsProps, |
| 20 | ref: ForwardedRef<IPlatsParamsRef>, |
| 21 | ) => { |
| 22 | const { t } = useTransClient('publish') |
| 23 | const { pubParmasTextareaCommonParams, setOnePubParams } = usePlatParamsCommon( |
| 24 | pubItem, |
| 25 | isMobile, |
| 26 | ) |
| 27 | |
| 28 | return ( |
| 29 | <> |
| 30 | <PubParmasTextarea |
| 31 | {...pubParmasTextareaCommonParams} |
| 32 | extend={( |
| 33 | <> |
| 34 | <div className="flex items-center h-8 mt-2.5"> |
| 35 | <div className="shrink-0 w-[90px] mr-2.5">{t('form.title')}</div> |
| 36 | <Input |
| 37 | value={pubItem.params.title} |
| 38 | placeholder={t('form.titlePlaceholder')} |
| 39 | data-testid="publish-title-input" |
| 40 | onChange={(e) => { |
| 41 | setOnePubParams({ title: e.target.value }, pubItem.account.id) |
| 42 | }} |
| 43 | /> |
| 44 | </div> |
| 45 | </> |
| 46 | )} |
| 47 | /> |
| 48 | </> |
| 49 | ) |
| 50 | }, |
| 51 | ), |
| 52 | ) |
| 53 | |
| 54 | export default WxGzhParams |
| 55 |