Files
fredy/ui/src/components/segment/SegmentPart.jsx

27 lines
623 B
React
Raw Normal View History

2025-12-11 10:40:55 +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';
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
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>
);
};