BookmarkFolderNameInput.tsx 791 B

123456789101112131415161718192021222324252627282930
  1. import { useTranslation } from 'next-i18next';
  2. import { ValidationTarget } from '~/client/util/input-validator';
  3. import ClosableTextInput from '~/components/Common/ClosableTextInput';
  4. type Props = {
  5. onClickOutside: () => void
  6. onPressEnter: (folderName: string) => void
  7. value?: string
  8. }
  9. export const BookmarkFolderNameInput = (props: Props): JSX.Element => {
  10. const {
  11. onClickOutside, onPressEnter, value,
  12. } = props;
  13. const { t } = useTranslation();
  14. return (
  15. <div className="flex-fill folder-name-input">
  16. <ClosableTextInput
  17. value={value}
  18. placeholder={t('bookmark_folder.input_placeholder')}
  19. onClickOutside={onClickOutside}
  20. onPressEnter={onPressEnter}
  21. validationTarget={ValidationTarget.FOLDER}
  22. />
  23. </div>
  24. );
  25. };