Line data Source code
1 : /*
2 : * Copyright (C) 2024 Red Hat, Inc.
3 : * SPDX-License-Identifier: LGPL-2.1-or-later
4 : */
5 :
6 : /* This is our version of the PatternFly Truncate component. We have
7 : it since we don't want Patternfly's unconditional tooltip.
8 :
9 : Truncation in the middle doesn't work with Patternsfly's approach
10 : in mixed RTL/LTR environments, so we only offer truncation at the
11 : end.
12 : */
13 :
14 113 : import * as React from "react";
15 : import './cockpit-components-truncate.scss';
16 :
17 110 : export const Truncate = ({
18 110 : content,
19 110 : ...props
20 110 : }: {
21 : content: string,
22 110 : }) => {
23 110 : return (
24 110 : <span className="pf-v6-c-truncate ct-no-truncate-min-width" {...props}>
25 110 : <span className="pf-v6-c-truncate__start">
26 110 : {content}
27 110 : </span>
28 110 : </span>
29 : );
30 110 : };
|