Spaces:
Running
Running
File size: 1,706 Bytes
e48ff6a |
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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
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"},
),
],
) |