Files
astuto/app/javascript/components/Comments/NewCommentUpdateSection.tsx
Riccardo Graziosi 78049a820c Add internationalization (#114)
🇬🇧 and 🇮🇹
2022-06-05 11:40:43 +02:00

35 lines
815 B
TypeScript

import * as React from 'react';
import I18n from 'i18n-js';
import { MutedText } from '../shared/CustomTexts';
interface Props {
postUpdateFlagValue: boolean;
handlePostUpdateFlag(): void;
}
const NewCommentUpdateSection = ({
postUpdateFlagValue,
handlePostUpdateFlag,
}: Props) => (
<div className="commentIsUpdateForm">
<div>
<input
id="isPostUpdateFlag"
type="checkbox"
onChange={handlePostUpdateFlag}
checked={postUpdateFlagValue || false}
/>
&nbsp;
<label htmlFor="isPostUpdateFlag">{I18n.t('post.new_comment.is_post_update')}</label>
</div>
{
postUpdateFlagValue ?
<MutedText>{I18n.t('post.new_comment.user_notification')}</MutedText>
:
null
}
</div>
);
export default NewCommentUpdateSection;