mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-09-24 04:26:14 +00:00
Fixed title to also have a description
This commit is contained in:
parent
977fdc0ea5
commit
a63708bb3f
@ -1469,6 +1469,7 @@
|
||||
"tags": "auto-detect,header-based,organize,relabel",
|
||||
"title": "Auto Rename",
|
||||
"header": "Auto Rename PDF",
|
||||
"description": "Automatically finds the best title from your PDF content and uses it as the filename.",
|
||||
"submit": "Auto Rename",
|
||||
"files": {
|
||||
"placeholder": "Select a PDF file in the main view to get started"
|
||||
|
@ -5,6 +5,7 @@ import { Tooltip } from '../../shared/Tooltip';
|
||||
|
||||
export interface ToolWorkflowTitleProps {
|
||||
title: string;
|
||||
description?: string;
|
||||
tooltip?: {
|
||||
content?: React.ReactNode;
|
||||
tips?: any[];
|
||||
@ -15,10 +16,19 @@ export interface ToolWorkflowTitleProps {
|
||||
};
|
||||
}
|
||||
|
||||
export function ToolWorkflowTitle({ title, tooltip }: ToolWorkflowTitleProps) {
|
||||
if (tooltip) {
|
||||
return (
|
||||
<>
|
||||
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="gpp-maybe-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}
|
||||
@ -26,27 +36,17 @@ export function ToolWorkflowTitle({ title, tooltip }: ToolWorkflowTitleProps) {
|
||||
header={tooltip.header}
|
||||
sidebarTooltip={true}
|
||||
>
|
||||
<Flex align="center" gap="xs" onClick={(e) => e.stopPropagation()}>
|
||||
<Text fw={500} size="xl" p="md">
|
||||
{title}
|
||||
</Text>
|
||||
<LocalIcon icon="gpp-maybe-outline-rounded" width="1.25rem" height="1.25rem" style={{ color: 'var(--icon-files-color)' }} />
|
||||
</Flex>
|
||||
{titleContent}
|
||||
</Tooltip>
|
||||
</Flex>
|
||||
<Divider />
|
||||
</>
|
||||
);
|
||||
}
|
||||
) : (
|
||||
titleContent
|
||||
)}
|
||||
|
||||
return (
|
||||
<>
|
||||
<Flex justify="center" w="100%">
|
||||
<Text fw={500} size="xl" p="md">
|
||||
{title}
|
||||
</Text>
|
||||
</Flex>
|
||||
<Divider />
|
||||
<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" />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
@ -11,7 +11,6 @@ export const useAutoRenameTips = (): TooltipContent => {
|
||||
tips: [
|
||||
{
|
||||
title: t("auto-rename.tooltip.howItWorks.title", "Smart Renaming"),
|
||||
description: t("auto-rename.tooltip.howItWorks.text", "Automatically finds the best title from your PDF content and uses it as the filename."),
|
||||
bullets: [
|
||||
t("auto-rename.tooltip.howItWorks.bullet1", "Looks for text that appears to be a title or heading"),
|
||||
t("auto-rename.tooltip.howItWorks.bullet2", "Creates a clean, valid filename from the detected title"),
|
||||
|
@ -18,7 +18,7 @@ const AutoRename =(props: BaseToolProps) => {
|
||||
);
|
||||
|
||||
return createToolFlow({
|
||||
title: { title:t("auto-rename.title", "Auto Rename PDF"), tooltip: useAutoRenameTips()},
|
||||
title: { title:t("auto-rename.title", "Auto Rename PDF"), description: t("auto-rename.description", "Auto Rename PDF"), tooltip: useAutoRenameTips()},
|
||||
files: {
|
||||
selectedFiles: base.selectedFiles,
|
||||
isCollapsed: base.hasResults,
|
||||
|
Loading…
x
Reference in New Issue
Block a user