Merge branch 'main' into tools-filtering

This commit is contained in:
AshAnand34
2025-07-18 14:45:15 -07:00
336 changed files with 21767 additions and 2122 deletions

View File

@@ -11,6 +11,7 @@ import { FFmpeg } from '@ffmpeg/ffmpeg';
import { fetchFile } from '@ffmpeg/util';
import { debounce } from 'lodash';
import ToolVideoInput from '@components/input/ToolVideoInput';
import { useTranslation } from 'react-i18next';
const ffmpeg = new FFmpeg();
@@ -28,6 +29,7 @@ const validationSchema = Yup.object({
});
export default function TrimVideo({ title }: ToolComponentProps) {
const { t } = useTranslation('video');
const [input, setInput] = useState<File | null>(null);
const [result, setResult] = useState<File | null>(null);
@@ -85,7 +87,7 @@ export default function TrimVideo({ title }: ToolComponentProps) {
updateField
}) => [
{
title: 'Timestamps',
title: t('trim.timestamps'),
component: (
<Box>
<TextFieldWithDesc
@@ -93,7 +95,7 @@ export default function TrimVideo({ title }: ToolComponentProps) {
updateNumberField(value, 'trimStart', updateField)
}
value={values.trimStart}
label={'Start Time'}
label={t('trim.startTime')}
sx={{ mb: 2, backgroundColor: 'background.paper' }}
/>
<TextFieldWithDesc
@@ -101,7 +103,7 @@ export default function TrimVideo({ title }: ToolComponentProps) {
updateNumberField(value, 'trimEnd', updateField)
}
value={values.trimEnd}
label={'End Time'}
label={t('trim.endTime')}
/>
</Box>
)
@@ -116,7 +118,7 @@ export default function TrimVideo({ title }: ToolComponentProps) {
<ToolVideoInput
value={input}
onChange={setInput}
title={'Input Video'}
title={t('trim.inputTitle')}
showTrimControls={true}
onTrimChange={(trimStart, trimEnd) => {
setFieldValue('trimStart', trimStart);
@@ -129,7 +131,7 @@ export default function TrimVideo({ title }: ToolComponentProps) {
}}
resultComponent={
<ToolFileResult
title={'Trimmed Video'}
title={t('trim.resultTitle')}
value={result}
extension={'mp4'}
/>

View File

@@ -2,27 +2,14 @@ import { defineTool } from '@tools/defineTool';
import { lazy } from 'react';
export const tool = defineTool('video', {
name: 'Trim video',
path: 'trim',
icon: 'material-symbols:content-cut',
description:
'Cut and trim video files to extract specific segments by specifying start and end times.',
shortDescription:
'Trim video files to extract specific time segments (MP4, MOV, AVI).',
keywords: [
'trim',
'video',
'cut',
'segment',
'extract',
'mp4',
'mov',
'avi',
'video editing',
'time'
],
longDescription:
'This tool allows you to trim video files by specifying start and end times. You can extract specific segments from longer videos, remove unwanted parts, or create shorter clips. Supports various video formats including MP4, MOV, and AVI. Perfect for video editing, content creation, or any video processing needs.',
userTypes: ['General Users', 'Students', 'Developers'],
component: lazy(() => import('./index'))
keywords: ['video', 'trim', 'cut', 'edit', 'time'],
component: lazy(() => import('./index')),
i18n: {
name: 'video:trim.title',
description: 'video:trim.description',
shortDescription: 'video:trim.shortDescription',
userTypes: ['General Users', 'Students', 'Developers']
}
});