diff options
Diffstat (limited to 'src/components/Image.astro')
-rw-r--r-- | src/components/Image.astro | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/components/Image.astro b/src/components/Image.astro new file mode 100644 index 0000000..07dbadf --- /dev/null +++ b/src/components/Image.astro @@ -0,0 +1,21 @@ +--- +export interface Props { + image: string; + fileType: string; +} + +const { image, fileType } = Astro.props; +--- + +{(image!= null) && ( + (fileType == 'image') ? ( + <a href={image} target="_blank" rel="noopener noreferrer"> + <img src={image} alt={image} height="300px" width="300px"> <br> + </a> + ) : ( + (fileType == 'image') && ( + <video width="320" height="240" controls muted> + <source src={image}> + </video> + )) +)}
\ No newline at end of file |