All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.js.configuration_browse.StructureList.tsx Maven / Gradle / Ivy

There is a newer version: 5.0.181
Show newest version
/**
 * 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