From 6b7a96dc067f89998c509efde3b49638e3e51fc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Wed, 13 Nov 2024 21:28:17 +0100 Subject: [PATCH] make PopoverTruncated customizable --- common/components.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/components.py b/common/components.py index 9d7e276..527ecd7 100644 --- a/common/components.py +++ b/common/components.py @@ -68,8 +68,8 @@ def Popover( ) -def PopoverTruncated(input_string: str) -> str: - if (truncated := truncate(input_string)) != input_string: +def PopoverTruncated(input_string: str, length: int = 30, ellipsis: str = "…") -> str: + if (truncated := truncate(input_string, length, ellipsis)) != input_string: return Popover(wrapped_content=truncated, popover_content=input_string) else: return input_string