Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion app/app/markdoc.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineMarkdocConfig, nodes } from '@astrojs/markdoc/config'
import { defineMarkdocConfig, component, nodes } from '@astrojs/markdoc/config'

export default defineMarkdocConfig({
nodes: {
Expand All @@ -7,4 +7,12 @@ export default defineMarkdocConfig({
render: null,
},
},
tags: {
signatures: {
render: component('./src/components/Signatures.astro'),
attributes: {
data: { type: Array },
},
},
},
})
56 changes: 56 additions & 0 deletions app/app/src/components/Signatures.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
interface DataItem
{
title: string,
signature_top_margin?: number,
signature_placeholder?: string,
}

export interface Props
{
data: Array<DataItem>
}
---

<table>
<thead>
<tr>
{Astro.props.data.map((item: DataItem) => (
<th align="left">
{item.title}
</th>
))}
</tr>
</thead>
<tbody>
<tr>
{Astro.props.data.map((item: DataItem) => (
<td align="left">
<div
class="signature"
style={item.signature_top_margin ? `margin-top: ${item.signature_top_margin}` : undefined}
>
<span class="faded-text">
{item.signature_placeholder || 'Signature'}
</span>
</div>
</td>
))}
</tr>
<tr>
{Astro.props.data.map((item: DataItem) => (
<td align="left">
Fait le : <span class="input-line"></span><span class="input-line input-line-next"></span>
</td>
))}
</tr>
</tbody>
</table>

<style lang="scss">
table {
width: 100%;
border-collapse: collapse;
table-layout: fixed; // Equal column widths
}
</style>
Loading