2025-12-11 10:40:55 +01:00
|
|
|
/*
|
2026-01-12 15:00:36 +01:00
|
|
|
* Copyright (c) 2026 by Christian Kellner.
|
2025-12-11 10:40:55 +01:00
|
|
|
* Licensed under Apache-2.0 with Commons Clause and Attribution/Naming Clause
|
|
|
|
|
*/
|
|
|
|
|
|
2022-03-27 19:42:58 +02:00
|
|
|
import React from 'react';
|
2026-01-22 16:09:36 +01:00
|
|
|
import { Card } from '@douyinfe/semi-ui-19';
|
2022-03-27 19:42:58 +02:00
|
|
|
|
|
|
|
|
import './SegmentParts.less';
|
|
|
|
|
|
2025-12-14 12:23:59 +01:00
|
|
|
export const SegmentPart = ({ name, Icon = null, children, helpText = null }) => {
|
2023-03-20 08:52:13 +01:00
|
|
|
const { Meta } = Card;
|
2022-03-27 19:42:58 +02:00
|
|
|
|
2023-03-20 08:52:13 +01:00
|
|
|
return (
|
|
|
|
|
<Card
|
2025-09-29 20:36:56 +02:00
|
|
|
className="segmentParts"
|
2023-03-20 08:52:13 +01:00
|
|
|
title={
|
2025-12-14 12:23:59 +01:00
|
|
|
(helpText || name) && (
|
|
|
|
|
<Meta title={name} description={helpText} avatar={Icon == null ? null : <Icon size="extra-extra-small" />} />
|
|
|
|
|
)
|
2022-03-27 19:42:58 +02:00
|
|
|
}
|
2023-03-20 08:52:13 +01:00
|
|
|
>
|
2022-03-27 19:42:58 +02:00
|
|
|
{children}
|
2023-03-20 08:52:13 +01:00
|
|
|
</Card>
|
|
|
|
|
);
|
|
|
|
|
};
|