mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-20 03:26:47 +08:00
36 lines
741 B
TypeScript
36 lines
741 B
TypeScript
import type { FC, PropsWithChildren, CSSProperties } from 'react';
|
|
import { Clickable } from '../clickable';
|
|
import { styled } from '../styled';
|
|
|
|
interface ListItemProps {
|
|
active?: boolean;
|
|
onClick?: () => void;
|
|
className?: string;
|
|
style?: CSSProperties;
|
|
}
|
|
|
|
export const ListItem: FC<PropsWithChildren<ListItemProps>> = ({
|
|
active,
|
|
children,
|
|
onClick,
|
|
className,
|
|
style,
|
|
}) => {
|
|
return (
|
|
<Container
|
|
active={active}
|
|
onClick={onClick}
|
|
className={className}
|
|
style={style}
|
|
>
|
|
{children}
|
|
</Container>
|
|
);
|
|
};
|
|
|
|
const Container = styled(Clickable)({
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
padding: '6px 12px',
|
|
});
|