mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-06 00:07:44 +01:00
9902494f58
* refactor: add missing event arg type * refactor: fix project card popup position * refactor: add tooltip arrows * refactor: update snapshot * refactor: add missing tooltips * refactor: use a custom Autocomplete size in AutocompleteBox
52 lines
1.8 KiB
TypeScript
52 lines
1.8 KiB
TypeScript
import {
|
|
List,
|
|
ListItem,
|
|
ListItemAvatar,
|
|
ListItemText,
|
|
Tooltip,
|
|
} from '@mui/material';
|
|
import { Pause, PlayArrow } from '@mui/icons-material';
|
|
import styles from 'component/common/common.module.scss';
|
|
import { Link } from 'react-router-dom';
|
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
|
import { FeatureSchema } from 'openapi';
|
|
|
|
interface ITogglesLinkListProps {
|
|
toggles: FeatureSchema[];
|
|
}
|
|
|
|
export const TogglesLinkList = ({ toggles }: ITogglesLinkListProps) => (
|
|
<List style={{ textAlign: 'left' }} className={styles.truncate}>
|
|
<ConditionallyRender
|
|
condition={toggles.length > 0}
|
|
show={toggles.map(({ name, description = '-', enabled }) => (
|
|
<ListItem key={name}>
|
|
<ListItemAvatar>
|
|
<ConditionallyRender
|
|
condition={Boolean(enabled)}
|
|
show={
|
|
<Tooltip title="Enabled" arrow>
|
|
<PlayArrow aria-hidden={false} />
|
|
</Tooltip>
|
|
}
|
|
elseShow={
|
|
<Tooltip title="Disabled" arrow>
|
|
<Pause aria-hidden={false} />
|
|
</Tooltip>
|
|
}
|
|
/>
|
|
</ListItemAvatar>
|
|
<ListItemText
|
|
primary={
|
|
<Link key={name} to={`/features/view/${name}`}>
|
|
{name}
|
|
</Link>
|
|
}
|
|
secondary={description}
|
|
/>
|
|
</ListItem>
|
|
))}
|
|
/>
|
|
</List>
|
|
);
|