Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
import ClayButton from '@clayui/button';
import ClayDropDown from '@clayui/drop-down';
import ClayForm, {ClayInput} from '@clayui/form';
import ClayIcon from '@clayui/icon';
import {
createPortletURL,
getPortletNamespace,
openModal,
openSelectionModal,
openToast,
sub,
} from 'frontend-js-web';
import React, {useMemo, useState} from 'react';
export default function AssetDisplayPagePreview({
newArticle,
portletNamespace: namespace,
previewURL,
saveAsDraftURL,
selectAssetDisplayPageEventName,
selectAssetDisplayPageURL,
selectSiteEventName,
siteItemSelectorURL,
sites,
sitesCount,
}) {
const [selectedSite, setSelectedSite] = useState();
const [active, setActive] = useState(false);
const [assetDisplayPageSelected, setAssetDisplayPageSelected] = useState();
const siteInputId = `${namespace}siteInput`;
const items = useMemo(() => {
return [
{groupId: 0, name: `- ${Liferay.Language.get('not-selected')} -`},
...sites,
].map((site) => ({
label: site.name,
onClick: () => {
setActive(false);
setSelectedSite({groupId: site.groupId, name: site.name});
},
}));
}, [sites]);
return (
<>
{selectedSite?.name ||
`- ${Liferay.Language.get('not-selected')} -`}
}
>
{items.map((item) => (
{item.label}
))}
{sitesCount > sites.length && (
<>
{sub(
Liferay.Language.get('showing-x-of-x-items'),
sites.length,
sitesCount
)}