aboutsummaryrefslogtreecommitdiff
path: root/apps/website/src/components/page/branding/BrandingImage.astro
blob: f85364d7dc8ce9d1d07713e5031ea6e0b48fac37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
---
interface Props {
	type: 'badges' | 'logos' | 'mods'
	name: string
	altText?: string
	extensions?: ('png' | 'svg')[]
	maxWidth?: number
	background?: string
}

const {
	name,
	type,
	altText,
	background = 'white',
	maxWidth = 300,
	extensions = ['png', 'svg'],
} = Astro.props;

const path = `/media/branding/${type}/${name}`;
---

<div class={`relative rounded-md bg-${background} border border-1 border-gray-400 flex flex-col justify-center items-center p-8`}>
	<div class="absolute top-0 right-0 flex flex-row gap-x-2">
		{extensions.map(ext => (
			<a target="_blank" class="text-xs px-0.5 hover:underline" href={`${path}.${ext}`}>.{ext.toUpperCase()}</a>
		))}
	</div>
	<img style={`max-width: ${maxWidth}px;`} src={`${path}.svg`} alt={altText}>
</div>