mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-09-24 04:26:14 +00:00

# Description of Changes ## Before <img width="102" height="35" alt="image" src="https://github.com/user-attachments/assets/fcb85906-85b6-41e1-9162-4084c0e684ec" /> ## After <img width="103" height="45" alt="image" src="https://github.com/user-attachments/assets/241d61d8-d3c4-4dbf-a6af-4fda0867734d" />
53 lines
1.4 KiB
TypeScript
53 lines
1.4 KiB
TypeScript
import React from 'react';
|
|
import { Flex, Text, Divider } from '@mantine/core';
|
|
import LocalIcon from '../../shared/LocalIcon';
|
|
import { Tooltip } from '../../shared/Tooltip';
|
|
|
|
export interface ToolWorkflowTitleProps {
|
|
title: string;
|
|
description?: string;
|
|
tooltip?: {
|
|
content?: React.ReactNode;
|
|
tips?: any[];
|
|
header?: {
|
|
title: string;
|
|
logo?: React.ReactNode;
|
|
};
|
|
};
|
|
}
|
|
|
|
export function ToolWorkflowTitle({ title, tooltip, description }: ToolWorkflowTitleProps) {
|
|
const titleContent = (
|
|
<Flex align="center" gap="xs" onClick={(e) => e.stopPropagation()}>
|
|
<Text fw={500} size="lg" p="xs">
|
|
{title}
|
|
</Text>
|
|
{tooltip && <LocalIcon icon="info-outline-rounded" width="1.25rem" height="1.25rem" style={{ color: 'var(--icon-files-color)' }} />}
|
|
</Flex>
|
|
);
|
|
|
|
return (
|
|
<>
|
|
{tooltip ? (
|
|
<Flex justify="center" w="100%">
|
|
<Tooltip
|
|
content={tooltip.content}
|
|
tips={tooltip.tips}
|
|
header={tooltip.header}
|
|
sidebarTooltip={true}
|
|
>
|
|
{titleContent}
|
|
</Tooltip>
|
|
</Flex>
|
|
) : (
|
|
titleContent
|
|
)}
|
|
|
|
<Text size="sm" mb="md" p="sm" style={{borderRadius:'var(--mantine-radius-md)', background: 'var(--color-gray-200)', color: 'var(--mantine-color-text)' }}>
|
|
{description}
|
|
</Text>
|
|
<Divider mb="sm" />
|
|
</>
|
|
);
|
|
}
|