mirror of
https://github.com/iib0011/omni-tools.git
synced 2025-11-16 21:08:33 +05:30
22 lines
586 B
TypeScript
22 lines
586 B
TypeScript
export interface BaseFileInputProps {
|
|
value: File | null;
|
|
onChange: (file: File) => void;
|
|
accept: string[];
|
|
title?: string;
|
|
}
|
|
|
|
export const formatTime = (seconds: number): string => {
|
|
const minutes = Math.floor(seconds / 60);
|
|
const remainingSeconds = Math.floor(seconds % 60);
|
|
return `${minutes.toString().padStart(2, '0')}:${remainingSeconds
|
|
.toString()
|
|
.padStart(2, '0')}`;
|
|
};
|
|
|
|
export const createObjectURL = (file: File): string => {
|
|
return URL.createObjectURL(file);
|
|
};
|
|
|
|
export const revokeObjectURL = (url: string): void => {
|
|
URL.revokeObjectURL(url);
|
|
};
|