aboutsummaryrefslogtreecommitdiff
path: root/src/components/Image.astro
blob: 07dbadf3cfd7b6947c6a7129aa1474bc8a7458b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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>
  ))
)}