restore/update eslint/prettier config
This commit is contained in:
+42
-40
@@ -1,56 +1,58 @@
|
||||
---
|
||||
import type { ImageMetadata } from 'astro';
|
||||
|
||||
interface Props {
|
||||
title?: string;
|
||||
image?: ImageMetadata;
|
||||
links?: {
|
||||
label: string;
|
||||
href: string;
|
||||
newWindow?: boolean;
|
||||
}[];
|
||||
title?: string;
|
||||
image?: ImageMetadata;
|
||||
links?: {
|
||||
label: string;
|
||||
href: string;
|
||||
newWindow?: boolean;
|
||||
}[];
|
||||
}
|
||||
|
||||
const { title, image, links } = Astro.props;
|
||||
---
|
||||
|
||||
<div class="card">
|
||||
{image && <img src={image.src} alt="" />}
|
||||
<div>
|
||||
{title && <h2>{title}</h2>}
|
||||
<slot />
|
||||
{
|
||||
links &&
|
||||
links.map((link) => (
|
||||
<a
|
||||
href={link.href}
|
||||
target={link.newWindow ? "_blank" : "_self"}
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
{link.label}
|
||||
</a>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
{image && <img src={image.src} alt="" />}
|
||||
<div>
|
||||
{title && <h2>{title}</h2>}
|
||||
<slot />
|
||||
{
|
||||
links &&
|
||||
links.map((link) => (
|
||||
<a
|
||||
href={link.href}
|
||||
target={link.newWindow ? '_blank' : '_self'}
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
{link.label}
|
||||
</a>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
@use "../styles/variables.scss" as *;
|
||||
@use '../styles/variables.scss' as *;
|
||||
|
||||
.card {
|
||||
border: var(--border);
|
||||
border-radius: $radius;
|
||||
overflow: hidden;
|
||||
.card {
|
||||
border: var(--border);
|
||||
border-radius: $radius;
|
||||
overflow: hidden;
|
||||
|
||||
& div {
|
||||
padding: 1rem;
|
||||
}
|
||||
& div {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
& h2 {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
& h2 {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
object-fit: cover;
|
||||
max-width: 100%;
|
||||
}
|
||||
img {
|
||||
object-fit: cover;
|
||||
max-width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user