META-INF.resources.js.info_box.modal.InfoBoxModalNotesInput.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com.liferay.commerce.order.content.web
Show all versions of com.liferay.commerce.order.content.web
Liferay Commerce Order Content Web
The newest version!
/**
* SPDX-FileCopyrightText: (c) 2024 Liferay, Inc. https://liferay.com
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/
import {ClayButtonWithIcon} from '@clayui/button';
import ClayDropDown from '@clayui/drop-down';
import {ClayInput, ClayToggle} from '@clayui/form';
import ClayIcon from '@clayui/icon';
import {InfiniteScrollerComponent} from 'commerce-frontend-js';
import moment from 'moment';
import React from 'react';
import UserIcon from '../../UserIcon';
const InfoBoxModalNotes = ({
handleDelete,
handleToggle,
isRestricted,
notes,
setInputValue,
spritemap,
}) => {
const formatUTCDate = (value) => {
return moment
.utc(value)
.locale(Liferay.ThemeDisplay.getBCP47LanguageId())
.startOf('seconds')
.fromNow();
};
return (
<>
{notes.map((note, index) => {
const {
author,
authorId,
authorPortraitURL,
content,
id,
modifiedDate,
restricted,
} = note;
return (
{author}
{themeDisplay.getUserId() ===
authorId.toString()
? ` (${Liferay.Language.get('you')})`
: null}
{formatUTCDate(modifiedDate)}
{restricted ? (
) : null}
{content}
}
>
{
handleDelete(id);
}}
>
{Liferay.Language.get(
'delete'
)}
);
})}
{
event.preventDefault();
setInputValue(event.target.value);
}}
placeholder={Liferay.Language.get(
'type-your-note-here'
)}
required={true}
type="text"
/>
{Liferay.Language.get('required')}
>
);
};
export default InfoBoxModalNotes;
© 2015 - 2025 Weber Informatics LLC | Privacy Policy