2024-03-25 16:23:38 +03:00

40 lines
861 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import style from '../AdminTable/Admin.module.css';
import type { CollapseProps } from 'antd';
import { Button, Collapse } from 'antd';
import styled from 'styled-components';
type IProps = {
readonly data: string;
readonly index: number;
readonly name: string;
readonly onClick: (name: string) => void;
};
const Wrapper = styled.div`
display: flex;
justify-content: space-between;
`;
export default function AdminRow(props: IProps) {
const { data, index, name, onClick } = props;
const handleClick = () => {
onClick(name);
};
const items: CollapseProps['items'] = [
{
children: <p>{data}</p>,
key: index.toString(),
label: data,
},
];
return (
<Wrapper>
<Collapse className={style.collapse} items={items} />
<Button onClick={handleClick}>Удалить</Button>
</Wrapper>
);
}