META-INF.resources.js.components.FDS.fdsUtils.fdsRenderers.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 ClayButton from '@clayui/button';
import ClayLabel from '@clayui/label';
import {ClayTooltipProvider} from '@clayui/tooltip';
import React, {Dispatch, SetStateAction} from 'react';
import StatusLabel from '../../StatusLabel';
import {wrapStringInForwardSlashes} from '../../utils/string';
export function getDisplayType(httpMethodName: string) {
if (httpMethodName === 'post') {
return 'success';
}
else {
return 'info';
}
}
export function itemMethodRenderer({
itemData,
}: {
itemData: {httpMethod: {name: string}};
}) {
return (
{itemData.httpMethod.name}
);
}
export function itemPathRenderer({
fdsItem,
setMainEndpointNav,
}: {
fdsItem: FDSItem;
setMainEndpointNav: Dispatch>;
}) {
const path = wrapStringInForwardSlashes(fdsItem.itemData.path);
return (
setMainEndpointNav({edit: fdsItem.itemData.id})
}
title={path}
>
{path}
);
}
export function itemStatusRenderer({itemData}: FDSItem) {
return ;
}
export function itemURLRenderer({itemData}: FDSItem) {
return wrapStringInForwardSlashes(itemData.baseURL);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy