aboutsummaryrefslogtreecommitdiff
path: root/src/components/Image.astro
diff options
context:
space:
mode:
authorkartofen <mladenovnasko0@gmail.com>2022-08-29 19:01:20 +0300
committerkartofen <mladenovnasko0@gmail.com>2022-08-29 19:01:20 +0300
commit8e4163e3f08e29f38fe87c59d8cfb91e0fa98063 (patch)
tree2b117f4bafa0a4d10252eef95ca868a247a081a1 /src/components/Image.astro
parent9d952483f250a97cbeab4061fa1c4e68341b330f (diff)
everything works
Diffstat (limited to 'src/components/Image.astro')
-rw-r--r--src/components/Image.astro21
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