añadido boton para desseleccionar imagen + un preview de la imagen

seleccionada
This commit is contained in:
2025-12-08 14:29:51 -03:00
parent 27eae9cb62
commit d08d2521b6
2 changed files with 58 additions and 9 deletions

View File

@@ -11,3 +11,14 @@ export type WithoutChild<T> = T extends { child?: any } ? Omit<T, 'child'> : T;
export type WithoutChildren<T> = T extends { children?: any } ? Omit<T, 'children'> : T;
export type WithoutChildrenOrChild<T> = WithoutChildren<WithoutChild<T>>;
export type WithElementRef<T, U extends HTMLElement = HTMLElement> = T & { ref?: U | null };
export function filtrarImagen(file) {
if (file) {
const allowed = ['image/png', 'image/jpg', 'image/jpeg', 'image/gif', 'image/webp'];
if (allowed.includes(file.type)) {
return file;
} else{
return null;
}
}
}