2023-10-16 15:14:04 +01:00
|
|
|
/*
|
2024-09-09 14:57:16 +01:00
|
|
|
Copyright 2024 New Vector Ltd.
|
2023-10-16 15:14:04 +01:00
|
|
|
Copyright 2023 The Matrix.org Foundation C.I.C.
|
|
|
|
|
|
2024-09-09 14:57:16 +01:00
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only
|
|
|
|
|
Please see LICENSE files in the repository root for full details.
|
2023-10-16 15:14:04 +01:00
|
|
|
*/
|
|
|
|
|
|
2024-08-05 08:59:27 +01:00
|
|
|
import React, { ReactNode } from "react";
|
2023-10-16 15:14:04 +01:00
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
|
label: string;
|
2024-08-05 08:59:27 +01:00
|
|
|
children?: ReactNode;
|
2023-10-16 15:14:04 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const enum SeparatorKind {
|
|
|
|
|
None,
|
|
|
|
|
Date,
|
|
|
|
|
LateEvent,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Generic timeline separator component to render within a MessagePanel
|
|
|
|
|
*
|
|
|
|
|
* @param label the accessible label string describing the separator
|
|
|
|
|
* @param children the children to draw within the timeline separator
|
|
|
|
|
*/
|
|
|
|
|
const TimelineSeparator: React.FC<Props> = ({ label, children }) => {
|
|
|
|
|
// ARIA treats <hr/>s as separators, here we abuse them slightly so manually treat this entire thing as one
|
|
|
|
|
return (
|
|
|
|
|
<div className="mx_TimelineSeparator" role="separator" aria-label={label}>
|
|
|
|
|
<hr role="none" />
|
|
|
|
|
{children}
|
|
|
|
|
<hr role="none" />
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default TimelineSeparator;
|