mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-09-21 06:59:33 +02:00
chore: show only necessary tags on a category
This commit is contained in:
@@ -2,17 +2,18 @@ import React, { useState, useEffect } from 'react';
|
|||||||
import { Box, Chip, Typography } from '@mui/material';
|
import { Box, Chip, Typography } from '@mui/material';
|
||||||
import { UserType } from '@tools/defineTool';
|
import { UserType } from '@tools/defineTool';
|
||||||
|
|
||||||
const userTypes: UserType[] = ['General Users', 'Developers', 'CyberSec'];
|
|
||||||
|
|
||||||
interface UserTypeFilterProps {
|
interface UserTypeFilterProps {
|
||||||
selectedUserTypes: UserType[];
|
selectedUserTypes: UserType[];
|
||||||
|
userTypes?: UserType[];
|
||||||
onUserTypesChange: (userTypes: UserType[]) => void;
|
onUserTypesChange: (userTypes: UserType[]) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function UserTypeFilter({
|
export default function UserTypeFilter({
|
||||||
selectedUserTypes,
|
selectedUserTypes,
|
||||||
onUserTypesChange
|
onUserTypesChange,
|
||||||
|
userTypes = ['General Users', 'Developers', 'CyberSec']
|
||||||
}: UserTypeFilterProps) {
|
}: UserTypeFilterProps) {
|
||||||
|
if (userTypes.length <= 1) return null;
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
|
@@ -88,6 +88,7 @@ const SingleCategory = function ({
|
|||||||
<Grid item xs={12} md={6}>
|
<Grid item xs={12} md={6}>
|
||||||
<Button
|
<Button
|
||||||
fullWidth
|
fullWidth
|
||||||
|
sx={{ height: '100%' }}
|
||||||
onClick={() => navigate('/categories/' + category.type)}
|
onClick={() => navigate('/categories/' + category.type)}
|
||||||
variant={'contained'}
|
variant={'contained'}
|
||||||
>
|
>
|
||||||
@@ -96,7 +97,7 @@ const SingleCategory = function ({
|
|||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12} md={6}>
|
<Grid item xs={12} md={6}>
|
||||||
<Button
|
<Button
|
||||||
sx={{ backgroundColor: 'background.default' }}
|
sx={{ backgroundColor: 'background.default', height: '100%' }}
|
||||||
fullWidth
|
fullWidth
|
||||||
onClick={() => navigate(category.example.path)}
|
onClick={() => navigate(category.example.path)}
|
||||||
variant={'outlined'}
|
variant={'outlined'}
|
||||||
|
@@ -43,13 +43,13 @@ export default function ToolsByCategory() {
|
|||||||
const { t } = useTranslation(validNamespaces);
|
const { t } = useTranslation(validNamespaces);
|
||||||
const rawTitle = getToolCategoryTitle(categoryName as string, t);
|
const rawTitle = getToolCategoryTitle(categoryName as string, t);
|
||||||
// First get tools by category without filtering
|
// First get tools by category without filtering
|
||||||
const toolsByCategory =
|
const toolsByCategory = getToolsByCategory(selectedUserTypes, t).find(
|
||||||
getToolsByCategory(selectedUserTypes, t).find(
|
({ type }) => type === categoryName
|
||||||
({ type }) => type === categoryName
|
);
|
||||||
)?.tools ?? [];
|
const categoryDefinedTools = toolsByCategory?.tools ?? [];
|
||||||
|
|
||||||
const categoryTools = filterTools(
|
const categoryTools = filterTools(
|
||||||
toolsByCategory,
|
categoryDefinedTools,
|
||||||
searchTerm,
|
searchTerm,
|
||||||
selectedUserTypes,
|
selectedUserTypes,
|
||||||
t
|
t
|
||||||
@@ -108,6 +108,7 @@ export default function ToolsByCategory() {
|
|||||||
my={2}
|
my={2}
|
||||||
>
|
>
|
||||||
<UserTypeFilter
|
<UserTypeFilter
|
||||||
|
userTypes={toolsByCategory?.userTypes ?? undefined}
|
||||||
selectedUserTypes={selectedUserTypes}
|
selectedUserTypes={selectedUserTypes}
|
||||||
onUserTypesChange={setSelectedUserTypes}
|
onUserTypesChange={setSelectedUserTypes}
|
||||||
/>
|
/>
|
||||||
|
@@ -6,8 +6,7 @@ export const tool = defineTool('csv', {
|
|||||||
name: 'csv:csvRowsToColumns.title',
|
name: 'csv:csvRowsToColumns.title',
|
||||||
description: 'csv:csvRowsToColumns.description',
|
description: 'csv:csvRowsToColumns.description',
|
||||||
shortDescription: 'csv:csvRowsToColumns.shortDescription',
|
shortDescription: 'csv:csvRowsToColumns.shortDescription',
|
||||||
longDescription: 'csv:csvRowsToColumns.longDescription',
|
longDescription: 'csv:csvRowsToColumns.longDescription'
|
||||||
userTypes: ['General Users', 'Developers']
|
|
||||||
},
|
},
|
||||||
path: 'csv-rows-to-columns',
|
path: 'csv-rows-to-columns',
|
||||||
icon: 'fluent:text-arrow-down-right-column-24-filled',
|
icon: 'fluent:text-arrow-down-right-column-24-filled',
|
||||||
|
@@ -5,8 +5,7 @@ export const tool = defineTool('csv', {
|
|||||||
i18n: {
|
i18n: {
|
||||||
name: 'csv:csvToJson.title',
|
name: 'csv:csvToJson.title',
|
||||||
description: 'csv:csvToJson.description',
|
description: 'csv:csvToJson.description',
|
||||||
shortDescription: 'csv:csvToJson.shortDescription',
|
shortDescription: 'csv:csvToJson.shortDescription'
|
||||||
userTypes: ['General Users', 'Developers']
|
|
||||||
},
|
},
|
||||||
|
|
||||||
path: 'csv-to-json',
|
path: 'csv-to-json',
|
||||||
|
@@ -6,8 +6,7 @@ export const tool = defineTool('csv', {
|
|||||||
name: 'csv:csvToTsv.title',
|
name: 'csv:csvToTsv.title',
|
||||||
description: 'csv:csvToTsv.description',
|
description: 'csv:csvToTsv.description',
|
||||||
shortDescription: 'csv:csvToTsv.shortDescription',
|
shortDescription: 'csv:csvToTsv.shortDescription',
|
||||||
longDescription: 'csv:csvToTsv.longDescription',
|
longDescription: 'csv:csvToTsv.longDescription'
|
||||||
userTypes: ['General Users', 'Developers']
|
|
||||||
},
|
},
|
||||||
|
|
||||||
path: 'csv-to-tsv',
|
path: 'csv-to-tsv',
|
||||||
|
@@ -5,8 +5,7 @@ export const tool = defineTool('csv', {
|
|||||||
i18n: {
|
i18n: {
|
||||||
name: 'csv:csvToXml.title',
|
name: 'csv:csvToXml.title',
|
||||||
description: 'csv:csvToXml.description',
|
description: 'csv:csvToXml.description',
|
||||||
shortDescription: 'csv:csvToXml.shortDescription',
|
shortDescription: 'csv:csvToXml.shortDescription'
|
||||||
userTypes: ['General Users', 'Developers']
|
|
||||||
},
|
},
|
||||||
|
|
||||||
path: 'csv-to-xml',
|
path: 'csv-to-xml',
|
||||||
|
@@ -6,8 +6,7 @@ export const tool = defineTool('csv', {
|
|||||||
name: 'csv:csvToYaml.title',
|
name: 'csv:csvToYaml.title',
|
||||||
description: 'csv:csvToYaml.description',
|
description: 'csv:csvToYaml.description',
|
||||||
shortDescription: 'csv:csvToYaml.shortDescription',
|
shortDescription: 'csv:csvToYaml.shortDescription',
|
||||||
longDescription: 'csv:csvToYaml.longDescription',
|
longDescription: 'csv:csvToYaml.longDescription'
|
||||||
userTypes: ['Developers']
|
|
||||||
},
|
},
|
||||||
|
|
||||||
path: 'csv-to-yaml',
|
path: 'csv-to-yaml',
|
||||||
|
@@ -11,7 +11,6 @@ export const tool = defineTool('csv', {
|
|||||||
i18n: {
|
i18n: {
|
||||||
name: 'csv:findIncompleteCsvRecords.title',
|
name: 'csv:findIncompleteCsvRecords.title',
|
||||||
description: 'csv:findIncompleteCsvRecords.description',
|
description: 'csv:findIncompleteCsvRecords.description',
|
||||||
shortDescription: 'csv:findIncompleteCsvRecords.shortDescription',
|
shortDescription: 'csv:findIncompleteCsvRecords.shortDescription'
|
||||||
userTypes: ['Developers']
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -5,8 +5,7 @@ export const tool = defineTool('csv', {
|
|||||||
i18n: {
|
i18n: {
|
||||||
name: 'csv:insertCsvColumns.title',
|
name: 'csv:insertCsvColumns.title',
|
||||||
description: 'csv:insertCsvColumns.description',
|
description: 'csv:insertCsvColumns.description',
|
||||||
shortDescription: 'csv:insertCsvColumns.shortDescription',
|
shortDescription: 'csv:insertCsvColumns.shortDescription'
|
||||||
userTypes: ['Developers']
|
|
||||||
},
|
},
|
||||||
|
|
||||||
path: 'insert-csv-columns',
|
path: 'insert-csv-columns',
|
||||||
|
@@ -6,8 +6,7 @@ export const tool = defineTool('csv', {
|
|||||||
name: 'csv:swapCsvColumns.title',
|
name: 'csv:swapCsvColumns.title',
|
||||||
description: 'csv:swapCsvColumns.description',
|
description: 'csv:swapCsvColumns.description',
|
||||||
shortDescription: 'csv:swapCsvColumns.shortDescription',
|
shortDescription: 'csv:swapCsvColumns.shortDescription',
|
||||||
longDescription: 'csv:swapCsvColumns.longDescription',
|
longDescription: 'csv:swapCsvColumns.longDescription'
|
||||||
userTypes: ['General Users', 'Developers']
|
|
||||||
},
|
},
|
||||||
|
|
||||||
path: 'swap-csv-columns',
|
path: 'swap-csv-columns',
|
||||||
|
@@ -6,8 +6,7 @@ export const tool = defineTool('csv', {
|
|||||||
name: 'csv:transposeCsv.title',
|
name: 'csv:transposeCsv.title',
|
||||||
description: 'csv:transposeCsv.description',
|
description: 'csv:transposeCsv.description',
|
||||||
shortDescription: 'csv:transposeCsv.shortDescription',
|
shortDescription: 'csv:transposeCsv.shortDescription',
|
||||||
longDescription: 'csv:transposeCsv.longDescription',
|
longDescription: 'csv:transposeCsv.longDescription'
|
||||||
userTypes: ['Developers']
|
|
||||||
},
|
},
|
||||||
|
|
||||||
path: 'transpose-csv',
|
path: 'transpose-csv',
|
||||||
|
@@ -6,7 +6,7 @@ export const tool = defineTool('image-generic', {
|
|||||||
name: 'image:compress.title',
|
name: 'image:compress.title',
|
||||||
description: 'image:compress.description',
|
description: 'image:compress.description',
|
||||||
shortDescription: 'image:compress.shortDescription',
|
shortDescription: 'image:compress.shortDescription',
|
||||||
userTypes: ['General Users', 'Developers']
|
userTypes: ['General Users']
|
||||||
},
|
},
|
||||||
|
|
||||||
path: 'compress',
|
path: 'compress',
|
||||||
|
@@ -6,7 +6,7 @@ export const tool = defineTool('image-generic', {
|
|||||||
name: 'image:resize.title',
|
name: 'image:resize.title',
|
||||||
description: 'image:resize.description',
|
description: 'image:resize.description',
|
||||||
shortDescription: 'image:resize.shortDescription',
|
shortDescription: 'image:resize.shortDescription',
|
||||||
userTypes: ['General Users', 'Developers']
|
userTypes: ['General Users']
|
||||||
},
|
},
|
||||||
|
|
||||||
path: 'resize',
|
path: 'resize',
|
||||||
|
@@ -10,7 +10,6 @@ export const tool = defineTool('json', {
|
|||||||
i18n: {
|
i18n: {
|
||||||
name: 'json:escapeJson.title',
|
name: 'json:escapeJson.title',
|
||||||
description: 'json:escapeJson.description',
|
description: 'json:escapeJson.description',
|
||||||
shortDescription: 'json:escapeJson.shortDescription',
|
shortDescription: 'json:escapeJson.shortDescription'
|
||||||
userTypes: ['Developers']
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -10,7 +10,6 @@ export const tool = defineTool('json', {
|
|||||||
i18n: {
|
i18n: {
|
||||||
name: 'json:jsonToXml.title',
|
name: 'json:jsonToXml.title',
|
||||||
description: 'json:jsonToXml.description',
|
description: 'json:jsonToXml.description',
|
||||||
shortDescription: 'json:jsonToXml.shortDescription',
|
shortDescription: 'json:jsonToXml.shortDescription'
|
||||||
userTypes: ['Developers']
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -10,7 +10,6 @@ export const tool = defineTool('json', {
|
|||||||
i18n: {
|
i18n: {
|
||||||
name: 'json:minify.title',
|
name: 'json:minify.title',
|
||||||
description: 'json:minify.description',
|
description: 'json:minify.description',
|
||||||
shortDescription: 'json:minify.shortDescription',
|
shortDescription: 'json:minify.shortDescription'
|
||||||
userTypes: ['Developers']
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -10,7 +10,6 @@ export const tool = defineTool('json', {
|
|||||||
i18n: {
|
i18n: {
|
||||||
name: 'json:prettify.title',
|
name: 'json:prettify.title',
|
||||||
description: 'json:prettify.description',
|
description: 'json:prettify.description',
|
||||||
shortDescription: 'json:prettify.shortDescription',
|
shortDescription: 'json:prettify.shortDescription'
|
||||||
userTypes: ['Developers']
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -10,7 +10,6 @@ export const tool = defineTool('json', {
|
|||||||
i18n: {
|
i18n: {
|
||||||
name: 'json:stringify.title',
|
name: 'json:stringify.title',
|
||||||
description: 'json:stringify.description',
|
description: 'json:stringify.description',
|
||||||
shortDescription: 'json:stringify.shortDescription',
|
shortDescription: 'json:stringify.shortDescription'
|
||||||
userTypes: ['Developers']
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -10,7 +10,6 @@ export const tool = defineTool('json', {
|
|||||||
i18n: {
|
i18n: {
|
||||||
name: 'json:tsvToJson.title',
|
name: 'json:tsvToJson.title',
|
||||||
description: 'json:tsvToJson.description',
|
description: 'json:tsvToJson.description',
|
||||||
shortDescription: 'json:tsvToJson.shortDescription',
|
shortDescription: 'json:tsvToJson.shortDescription'
|
||||||
userTypes: ['Developers']
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -10,7 +10,6 @@ export const tool = defineTool('json', {
|
|||||||
i18n: {
|
i18n: {
|
||||||
name: 'json:validateJson.title',
|
name: 'json:validateJson.title',
|
||||||
description: 'json:validateJson.description',
|
description: 'json:validateJson.description',
|
||||||
shortDescription: 'json:validateJson.shortDescription',
|
shortDescription: 'json:validateJson.shortDescription'
|
||||||
userTypes: ['General Users', 'Developers']
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -24,6 +24,6 @@ export const tool = defineTool('pdf', {
|
|||||||
name: 'pdf:compressPdf.title',
|
name: 'pdf:compressPdf.title',
|
||||||
description: 'pdf:compressPdf.description',
|
description: 'pdf:compressPdf.description',
|
||||||
shortDescription: 'pdf:compressPdf.shortDescription',
|
shortDescription: 'pdf:compressPdf.shortDescription',
|
||||||
userTypes: ['General Users', 'Developers']
|
userTypes: ['General Users']
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -6,7 +6,7 @@ export const tool = defineTool('pdf', {
|
|||||||
name: 'pdf:editor.title',
|
name: 'pdf:editor.title',
|
||||||
description: 'pdf:editor.description',
|
description: 'pdf:editor.description',
|
||||||
shortDescription: 'pdf:editor.shortDescription',
|
shortDescription: 'pdf:editor.shortDescription',
|
||||||
userTypes: ['General Users', 'Developers']
|
userTypes: ['General Users']
|
||||||
},
|
},
|
||||||
|
|
||||||
path: 'editor',
|
path: 'editor',
|
||||||
|
@@ -10,6 +10,6 @@ export const meta = defineTool('pdf', {
|
|||||||
name: 'pdf:mergePdf.title',
|
name: 'pdf:mergePdf.title',
|
||||||
description: 'pdf:mergePdf.description',
|
description: 'pdf:mergePdf.description',
|
||||||
shortDescription: 'pdf:mergePdf.shortDescription',
|
shortDescription: 'pdf:mergePdf.shortDescription',
|
||||||
userTypes: ['General Users', 'Developers']
|
userTypes: ['General Users']
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -10,6 +10,6 @@ export const meta = defineTool('pdf', {
|
|||||||
name: 'pdf:pdfToEpub.title',
|
name: 'pdf:pdfToEpub.title',
|
||||||
description: 'pdf:pdfToEpub.description',
|
description: 'pdf:pdfToEpub.description',
|
||||||
shortDescription: 'pdf:pdfToEpub.shortDescription',
|
shortDescription: 'pdf:pdfToEpub.shortDescription',
|
||||||
userTypes: ['General Users', 'Developers']
|
userTypes: ['General Users']
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -7,7 +7,7 @@ export const tool = defineTool('pdf', {
|
|||||||
description: 'pdf:pdfToPng.description',
|
description: 'pdf:pdfToPng.description',
|
||||||
shortDescription: 'pdf:pdfToPng.shortDescription',
|
shortDescription: 'pdf:pdfToPng.shortDescription',
|
||||||
longDescription: 'pdf:pdfToPng.longDescription',
|
longDescription: 'pdf:pdfToPng.longDescription',
|
||||||
userTypes: ['General Users', 'Developers']
|
userTypes: ['General Users']
|
||||||
},
|
},
|
||||||
|
|
||||||
path: 'pdf-to-png',
|
path: 'pdf-to-png',
|
||||||
|
@@ -23,6 +23,6 @@ export const tool = defineTool('pdf', {
|
|||||||
name: 'pdf:protectPdf.title',
|
name: 'pdf:protectPdf.title',
|
||||||
description: 'pdf:protectPdf.description',
|
description: 'pdf:protectPdf.description',
|
||||||
shortDescription: 'pdf:protectPdf.shortDescription',
|
shortDescription: 'pdf:protectPdf.shortDescription',
|
||||||
userTypes: ['General Users', 'Developers']
|
userTypes: ['General Users']
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -7,7 +7,7 @@ export const tool = defineTool('pdf', {
|
|||||||
description: 'pdf:rotatePdf.description',
|
description: 'pdf:rotatePdf.description',
|
||||||
shortDescription: 'pdf:rotatePdf.shortDescription',
|
shortDescription: 'pdf:rotatePdf.shortDescription',
|
||||||
longDescription: 'pdf:rotatePdf.longDescription',
|
longDescription: 'pdf:rotatePdf.longDescription',
|
||||||
userTypes: ['General Users', 'Developers']
|
userTypes: ['General Users']
|
||||||
},
|
},
|
||||||
|
|
||||||
path: 'rotate-pdf',
|
path: 'rotate-pdf',
|
||||||
|
@@ -10,6 +10,6 @@ export const meta = defineTool('pdf', {
|
|||||||
name: 'pdf:splitPdf.title',
|
name: 'pdf:splitPdf.title',
|
||||||
description: 'pdf:splitPdf.description',
|
description: 'pdf:splitPdf.description',
|
||||||
shortDescription: 'pdf:splitPdf.shortDescription',
|
shortDescription: 'pdf:splitPdf.shortDescription',
|
||||||
userTypes: ['General Users', 'Developers']
|
userTypes: ['General Users']
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -11,6 +11,6 @@ export const tool = defineTool('video', {
|
|||||||
name: 'video:changeSpeed.title',
|
name: 'video:changeSpeed.title',
|
||||||
description: 'video:changeSpeed.description',
|
description: 'video:changeSpeed.description',
|
||||||
shortDescription: 'video:changeSpeed.shortDescription',
|
shortDescription: 'video:changeSpeed.shortDescription',
|
||||||
userTypes: ['General Users', 'Developers']
|
userTypes: ['General Users']
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -22,6 +22,6 @@ export const tool = defineTool('video', {
|
|||||||
name: 'video:compress.title',
|
name: 'video:compress.title',
|
||||||
description: 'video:compress.description',
|
description: 'video:compress.description',
|
||||||
shortDescription: 'video:compress.shortDescription',
|
shortDescription: 'video:compress.shortDescription',
|
||||||
userTypes: ['General Users', 'Developers']
|
userTypes: ['General Users']
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -19,7 +19,7 @@ export const tool = defineTool('video', {
|
|||||||
name: 'video:cropVideo.title',
|
name: 'video:cropVideo.title',
|
||||||
description: 'video:cropVideo.description',
|
description: 'video:cropVideo.description',
|
||||||
shortDescription: 'video:cropVideo.shortDescription',
|
shortDescription: 'video:cropVideo.shortDescription',
|
||||||
userTypes: ['General Users', 'Developers']
|
userTypes: ['General Users']
|
||||||
},
|
},
|
||||||
component: lazy(() => import('./index'))
|
component: lazy(() => import('./index'))
|
||||||
});
|
});
|
||||||
|
@@ -11,6 +11,6 @@ export const tool = defineTool('video', {
|
|||||||
name: 'video:flip.title',
|
name: 'video:flip.title',
|
||||||
description: 'video:flip.description',
|
description: 'video:flip.description',
|
||||||
shortDescription: 'video:flip.shortDescription',
|
shortDescription: 'video:flip.shortDescription',
|
||||||
userTypes: ['General Users', 'Developers']
|
userTypes: ['General Users']
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -11,6 +11,6 @@ export const tool = defineTool('video', {
|
|||||||
name: 'video:loop.title',
|
name: 'video:loop.title',
|
||||||
description: 'video:loop.description',
|
description: 'video:loop.description',
|
||||||
shortDescription: 'video:loop.shortDescription',
|
shortDescription: 'video:loop.shortDescription',
|
||||||
userTypes: ['General Users', 'Developers']
|
userTypes: ['General Users']
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -11,6 +11,6 @@ export const tool = defineTool('video', {
|
|||||||
name: 'video:rotate.title',
|
name: 'video:rotate.title',
|
||||||
description: 'video:rotate.description',
|
description: 'video:rotate.description',
|
||||||
shortDescription: 'video:rotate.shortDescription',
|
shortDescription: 'video:rotate.shortDescription',
|
||||||
userTypes: ['General Users', 'Developers']
|
userTypes: ['General Users']
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -10,6 +10,6 @@ export const tool = defineTool('video', {
|
|||||||
name: 'video:trim.title',
|
name: 'video:trim.title',
|
||||||
description: 'video:trim.description',
|
description: 'video:trim.description',
|
||||||
shortDescription: 'video:trim.shortDescription',
|
shortDescription: 'video:trim.shortDescription',
|
||||||
userTypes: ['General Users', 'Developers']
|
userTypes: ['General Users']
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -10,6 +10,6 @@ export const tool = defineTool('video', {
|
|||||||
name: 'video:videoToGif.title',
|
name: 'video:videoToGif.title',
|
||||||
description: 'video:videoToGif.description',
|
description: 'video:videoToGif.description',
|
||||||
shortDescription: 'video:videoToGif.shortDescription',
|
shortDescription: 'video:videoToGif.shortDescription',
|
||||||
userTypes: ['General Users', 'Developers']
|
userTypes: ['General Users']
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@@ -145,8 +145,8 @@ export const filterToolsByUserTypes = (
|
|||||||
if (userTypes.length === 0) return tools;
|
if (userTypes.length === 0) return tools;
|
||||||
|
|
||||||
return tools.filter((tool) => {
|
return tools.filter((tool) => {
|
||||||
// Always treat xml tools as dev-only
|
const devToolsCategories: ToolCategory[] = ['xml', 'json', 'csv'];
|
||||||
if (tool.type === 'xml') {
|
if (devToolsCategories.includes(tool.type)) {
|
||||||
return userTypes.includes('Developers');
|
return userTypes.includes('Developers');
|
||||||
}
|
}
|
||||||
// If tool has no userTypes defined, show it to all users
|
// If tool has no userTypes defined, show it to all users
|
||||||
|
Reference in New Issue
Block a user