META-INF.resources.js.configuration_browse.StructureList.tsx Maven / Gradle / Ivy
/**
* SPDX-FileCopyrightText: (c) 2000 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 ClayTable from '@clayui/table';
import {sub} from 'frontend-js-web';
import React from 'react';
import {DDMStructure} from './HighlightedDDMStructuresConfiguration';
interface Props {
onRemoveStructure: (nextStructures: DDMStructure[]) => void;
structures: DDMStructure[];
}
export function StructureList({onRemoveStructure, structures}: Props) {
return structures.length ? (
{Liferay.Language.get('title')}
{Liferay.Language.get('scope')}
{sub(
Liferay.Language.get('remove-x'),
Liferay.Language.get('structure')
)}
{structures.map(({ddmStructureId, name, scope}) => (
{name}
{scope}
onRemoveStructure(
structures.filter(
(structure) =>
structure.ddmStructureId !==
ddmStructureId
)
)
}
symbol="times-circle"
title={Liferay.Language.get('remove')}
/>
))}
) : (
{sub(
Liferay.Language.get('no-x-selected'),
Liferay.Language.get('structures')
)}
);
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy