mirror of
https://github.com/docmost/docmost.git
synced 2025-11-23 06:21:09 +10:00
Add sidebar
This commit is contained in:
18
frontend/src/components/ui/button-with-icon.tsx
Normal file
18
frontend/src/components/ui/button-with-icon.tsx
Normal file
@ -0,0 +1,18 @@
|
||||
import { ReactNode } from 'react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
|
||||
interface ButtonIconProps {
|
||||
icon: ReactNode;
|
||||
children?: ReactNode;
|
||||
}
|
||||
|
||||
type Props = ButtonIconProps & React.ComponentPropsWithoutRef<typeof Button>;
|
||||
|
||||
export default function ButtonWithIcon({ icon, children, ...rest }: Props) {
|
||||
return (
|
||||
<Button {...rest} {...(children ? {} : { size: 'icon' })}>
|
||||
<div className={`${children ? 'mr-[8px]' : ''}`}>{icon}</div>
|
||||
{children}
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user