mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-12-29 16:16:02 +00:00
feat: shortDescription
This commit is contained in:
@@ -8,6 +8,7 @@ interface ToolOptions {
|
||||
image?: string;
|
||||
name: string;
|
||||
description: string;
|
||||
shortDescription: string;
|
||||
}
|
||||
|
||||
export interface DefinedTool {
|
||||
@@ -15,6 +16,7 @@ export interface DefinedTool {
|
||||
path: string;
|
||||
name: string;
|
||||
description: string;
|
||||
shortDescription: string;
|
||||
image?: string;
|
||||
keywords: string[];
|
||||
component: () => JSX.Element;
|
||||
@@ -24,7 +26,15 @@ export const defineTool = (
|
||||
basePath: string,
|
||||
options: ToolOptions
|
||||
): DefinedTool => {
|
||||
const { image, path, name, description, keywords, component } = options;
|
||||
const {
|
||||
image,
|
||||
path,
|
||||
name,
|
||||
description,
|
||||
keywords,
|
||||
component,
|
||||
shortDescription
|
||||
} = options;
|
||||
const Component = component;
|
||||
return {
|
||||
type: basePath,
|
||||
@@ -32,10 +42,16 @@ export const defineTool = (
|
||||
name,
|
||||
image,
|
||||
description,
|
||||
shortDescription,
|
||||
keywords,
|
||||
component: () => {
|
||||
return (
|
||||
<ToolLayout title={name} description={description} image={image}>
|
||||
<ToolLayout
|
||||
type={basePath}
|
||||
title={name}
|
||||
description={description}
|
||||
image={image}
|
||||
>
|
||||
<Component />
|
||||
</ToolLayout>
|
||||
);
|
||||
|
||||
@@ -38,6 +38,7 @@ export const filterTools = (
|
||||
(tool) =>
|
||||
tool.name.toLowerCase().includes(lowerCaseQuery) ||
|
||||
tool.description.toLowerCase().includes(lowerCaseQuery) ||
|
||||
tool.shortDescription.toLowerCase().includes(lowerCaseQuery) ||
|
||||
tool.keywords.some((keyword) =>
|
||||
keyword.toLowerCase().includes(lowerCaseQuery)
|
||||
)
|
||||
@@ -49,6 +50,7 @@ export const getToolsByCategory = (): {
|
||||
description: string;
|
||||
type: string;
|
||||
example: { title: string; path: string };
|
||||
tools: DefinedTool[];
|
||||
}[] => {
|
||||
const grouped: Partial<Record<string, DefinedTool[]>> = Object.groupBy(
|
||||
tools,
|
||||
@@ -60,6 +62,7 @@ export const getToolsByCategory = (): {
|
||||
description:
|
||||
categoriesDescriptions.find((desc) => desc.type === type)?.value ?? '',
|
||||
type,
|
||||
tools: tls ?? [],
|
||||
example: tls
|
||||
? { title: tls[0].name, path: tls[0].path }
|
||||
: { title: '', path: '' }
|
||||
|
||||
Reference in New Issue
Block a user