openreplay/frontend/app/components/shared/SessionItem/MetaMoreButton/MetaMoreButton.tsx
Андрей Бабушкин b822b1c067 applied eslint
2025-02-26 20:31:01 +01:00

36 lines
873 B
TypeScript

import React from 'react';
import { Popover } from 'UI';
import { Button } from 'antd';
import MetaItem from '../MetaItem';
interface Props {
list: any[];
maxLength: number;
}
export default function MetaMoreButton(props: Props) {
const { list, maxLength } = props;
return (
<Popover
render={() => (
<div
className="text-sm grid grid-col p-4 gap-3 bg-white"
style={{ maxHeight: '200px', overflowY: 'auto' }}
>
{list.slice(maxLength).map(({ label, value }, index) => (
<MetaItem key={index} label={label} value={value} />
))}
</div>
)}
placement="bottom"
>
<div className="flex items-center">
<Button variant="text">
+
{list.length - maxLength}
{' '}
More
</Button>
</div>
</Popover>
);
}