feat: type style change

This commit is contained in:
lhwan
2024-08-26 09:58:33 +08:00
parent 7ebb2dfb2d
commit 77e56d9fe7
2 changed files with 19 additions and 11 deletions

View File

@@ -50,9 +50,9 @@ const BlurredCard: React.FC<{
{name.length > 6 ? (
<Tooltip title={name}>
<span
className="truncate font-semibold text-base"
className="line-clamp-1 text-ellipsis font-semibold text-base"
style={{
maxWidth: '60%',
// maxWidth: '60%',
}}
>
{name}
@@ -60,9 +60,9 @@ const BlurredCard: React.FC<{
</Tooltip>
) : (
<span
className="truncate font-semibold text-base"
className="line-clamp-1 text-ellipsis font-semibold text-base"
style={{
maxWidth: '60%',
// maxWidth: '60%',
}}
>
{name}

View File

@@ -127,12 +127,20 @@ function Agent() {
},
];
const logoUrl = {
workflow: '/pictures/flow.png',
agents: '/pictures/agent.png',
resources: '/pictures/database.png',
apps: '/pictures/app.png',
operators: '/pictures/knowledge.png',
const logoFn = (type: string) => {
switch(type) {
case 'workflow':
return '/pictures/flow.png';
case 'resources':
return '/pictures/database.png';
case 'apps':
return '/pictures/app.png';
case 'operators':
return '/pictures/knowledge.png';
case 'agents':
default:
return '/pictures/agent.png';
};
}
return (
@@ -196,7 +204,7 @@ function Agent() {
<div className='flex flex-wrap'>
{agents.map((agent, index) => (
<BlurredCard
logo={logoUrl[agent.type]}
logo={logoFn(agent.type)}
onClick={() => {
if (agent.storage_url) window.open(agent.storage_url, '_blank');
}}