mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 08:42:12 +10:00
18 lines
462 B
TypeScript
18 lines
462 B
TypeScript
import { Img } from '../components';
|
|
|
|
export interface TemplateImageProps {
|
|
assetBaseUrl: string;
|
|
className?: string;
|
|
staticAsset: string;
|
|
}
|
|
|
|
export const TemplateImage = ({ assetBaseUrl, className, staticAsset }: TemplateImageProps) => {
|
|
const getAssetUrl = (path: string) => {
|
|
return new URL(path, assetBaseUrl).toString();
|
|
};
|
|
|
|
return <Img className={className} src={getAssetUrl(`/static/${staticAsset}`)} />;
|
|
};
|
|
|
|
export default TemplateImage;
|