@stihl-design-system/components
Version:
Welcome to the STIHL Design System react component library.
22 lines (21 loc) • 769 B
TypeScript
import { JSX } from 'react';
import { Theme } from '../../../../utils/theme';
import { InputFileTranslations } from '../../InputFile.utils';
export interface FilePreviewProps {
/**
* The file object to preview. Used to determine file type and generate preview.
*/
file: File;
/**
* Defines the theme.
* @default 'light'
*/
theme?: Theme;
t: (key: keyof InputFileTranslations, values?: Record<string, string | number>) => string;
}
/**
* Renders a preview for a file based on its type and extension.
* For displayable images, shows an actual image preview with error fallback.
* For other file types, shows an appropriate icon.
*/
export declare const FilePreview: ({ file, theme, t, }: FilePreviewProps) => JSX.Element;