aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/app/components/LineIcon.tsx
diff options
context:
space:
mode:
authorAriel Costas Guerrero <ariel@costas.dev>2025-11-03 11:20:27 +0100
committerAriel Costas Guerrero <ariel@costas.dev>2025-11-03 11:20:27 +0100
commit769d12a525875d3577b2868208d6315c56ce77d6 (patch)
tree4fa84a86a2eda352b6bea14e6ecab741134de62a /src/frontend/app/components/LineIcon.tsx
parent809941dcc8f37967a22516b1c4f7af1f3b8a82bc (diff)
Display available lines on StopSheet
Diffstat (limited to 'src/frontend/app/components/LineIcon.tsx')
-rw-r--r--src/frontend/app/components/LineIcon.tsx8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/frontend/app/components/LineIcon.tsx b/src/frontend/app/components/LineIcon.tsx
index 4f4bfd9..55e38c2 100644
--- a/src/frontend/app/components/LineIcon.tsx
+++ b/src/frontend/app/components/LineIcon.tsx
@@ -5,18 +5,20 @@ import { type RegionId } from "../data/RegionConfig";
interface LineIconProps {
line: string;
region?: RegionId;
+ rounded?: boolean;
}
-const LineIcon: React.FC<LineIconProps> = ({ line, region = "vigo" }) => {
+const LineIcon: React.FC<LineIconProps> = ({ line, region = "vigo", rounded = false }) => {
const formattedLine = useMemo(() => {
return /^[a-zA-Z]/.test(line) ? line : `L${line}`;
}, [line]);
const cssVarName = `--line-${region}-${formattedLine.toLowerCase()}`;
+ const cssTextVarName = `--line-${region}-${formattedLine.toLowerCase()}-text`;
return (
<span
- className="line-icon"
- style={{ borderColor: `var(${cssVarName})` }}
+ className={rounded ? 'line-icon-rounded' : 'line-icon'}
+ style={{ '--line-colour': `var(${cssVarName})`, '--line-text-colour': `var(${cssTextVarName}, unset)` } as React.CSSProperties}
>
{formattedLine}
</span>