Spaces:
Running
Running
from dash import html, dcc | |
import dash_mantine_components as dmc | |
from dash_iconify import DashIconify | |
def create_card(title, description, href, icon=None): | |
return dmc.Card( | |
shadow="sm", | |
padding="lg", | |
radius="md", | |
withBorder=True, | |
style={ | |
"height": "100%", | |
"display": "flex", | |
"flexDirection": "column", | |
}, | |
children=[ | |
dmc.Group( | |
justify="space-between", | |
mt="md", | |
mb="xs", | |
children=[ | |
dmc.Text( | |
title, | |
fw=500, | |
lineClamp=2, | |
style={"overflowWrap": "break-word", "wordBreak": "break-word"} | |
), | |
DashIconify( | |
icon=icon, width=30 | |
) if icon else dmc.Badge("Active", color="green", variant="light"), | |
], | |
), | |
dmc.Text( | |
description, | |
size="sm", | |
c="dimmed", | |
lineClamp=4, | |
style={"flexGrow": 1}, | |
), | |
dcc.Link( | |
dmc.Button( | |
variant="light", | |
color="blue", | |
fullWidth=True, | |
mt="md", | |
radius="md", | |
children="Ouvrir", | |
leftSection=DashIconify(icon="material-symbols:open-in-new"), | |
), | |
href=href, | |
style={"textDecoration": "none"}, | |
), | |
], | |
) |