@websolutespa/payload-plugin-bowl-llm
Version:
LLM plugin for Bowl PayloadCms plugin
40 lines (39 loc) • 1.81 kB
JavaScript
'use client';
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import { Button, useTranslation } from '@payloadcms/ui';
import React from 'react';
import './Llm.scss';
export const LlmLinksApp_ = ({ app })=>{
const { t } = useTranslation();
const linksGroups = app.linksGroups?.filter((x)=>x.links.length > 0);
const handleClick = (url)=>{
window.open(url, '_blank');
};
return /*#__PURE__*/ _jsx(_Fragment, {
children: linksGroups && linksGroups.length > 0 && /*#__PURE__*/ _jsx("div", {
className: "llm-links-groups",
children: linksGroups.length > 0 ? /*#__PURE__*/ _jsx(_Fragment, {
children: linksGroups.map((linksGroup)=>/*#__PURE__*/ _jsxs("div", {
className: "llm-links-group",
children: [
/*#__PURE__*/ _jsx("div", {
className: "llm-link-group-title",
children: linksGroup.title
}),
/*#__PURE__*/ _jsx("div", {
className: "llm-links",
children: linksGroup.links.map((link)=>/*#__PURE__*/ _jsx(Button, {
onClick: ()=>handleClick(link.url),
children: link.title
}, link.url))
})
]
}, linksGroup.title))
}) : /*#__PURE__*/ _jsx("p", {
children: t('general:emptyLlmAppLinks')
})
})
});
};
export const LlmLinksApp = /*#__PURE__*/ React.memo(LlmLinksApp_);
//# sourceMappingURL=LlmLinksApp.js.map