mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-12-21 11:06:59 +01:00
chore: tools by category
This commit is contained in:
@@ -5,14 +5,17 @@ interface ToolOptions {
|
||||
path: string;
|
||||
component: LazyExoticComponent<JSXElementConstructor<NonNullable<unknown>>>;
|
||||
keywords: string[];
|
||||
image?: string;
|
||||
name: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
export interface DefinedTool {
|
||||
type: string;
|
||||
path: string;
|
||||
name: string;
|
||||
description: string;
|
||||
image?: string;
|
||||
keywords: string[];
|
||||
component: () => JSX.Element;
|
||||
}
|
||||
@@ -21,16 +24,18 @@ export const defineTool = (
|
||||
basePath: string,
|
||||
options: ToolOptions
|
||||
): DefinedTool => {
|
||||
const { path, name, description, keywords, component } = options;
|
||||
const { image, path, name, description, keywords, component } = options;
|
||||
const Component = component;
|
||||
return {
|
||||
type: basePath,
|
||||
path: `${basePath}/${path}`,
|
||||
name,
|
||||
image,
|
||||
description,
|
||||
keywords,
|
||||
component: () => {
|
||||
return (
|
||||
<ToolLayout title={name} description={description}>
|
||||
<ToolLayout title={name} description={description} image={image}>
|
||||
<Component />
|
||||
</ToolLayout>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user