f1181e8510
Reviewed-on: #413 Co-authored-by: miteruzo <miteruzo@naver.com> Co-committed-by: miteruzo <miteruzo@naver.com>
49 行
1.1 KiB
TypeScript
49 行
1.1 KiB
TypeScript
import PostCoreDataFields from '@/components/posts/PostCoreDataFields'
|
|
import PostTextField from '@/components/posts/PostTextField'
|
|
|
|
import type { FC, ReactNode } from 'react'
|
|
|
|
import type { PostCoreDataFieldsProps } from '@/components/posts/PostCoreDataFields'
|
|
|
|
type TextMessages = string[] | undefined
|
|
|
|
type Props = {
|
|
url: {
|
|
value: string
|
|
onChange: (value: string) => void
|
|
errors?: TextMessages
|
|
warnings?: TextMessages
|
|
disabled?: boolean
|
|
type?: string
|
|
placeholder?: string }
|
|
thumbnailField: ReactNode
|
|
core: PostCoreDataFieldsProps
|
|
extraFields?: ReactNode }
|
|
|
|
|
|
const PostCreationDataFields: FC<Props> = (
|
|
{ url,
|
|
thumbnailField,
|
|
core,
|
|
extraFields },
|
|
) => (
|
|
<>
|
|
<PostTextField
|
|
label="URL"
|
|
type={url.type}
|
|
value={url.value}
|
|
disabled={url.disabled}
|
|
warnings={url.warnings}
|
|
errors={url.errors}
|
|
placeholder={url.placeholder}
|
|
onChange={url.onChange}/>
|
|
|
|
{thumbnailField}
|
|
|
|
<PostCoreDataFields {...core}/>
|
|
|
|
{extraFields}
|
|
</>)
|
|
|
|
export default PostCreationDataFields
|