Skip to content

Commit

Permalink
spread
Browse files Browse the repository at this point in the history
  • Loading branch information
chdeskur committed Oct 4, 2024
1 parent 1caa826 commit 0fe07b1
Showing 1 changed file with 16 additions and 33 deletions.
49 changes: 16 additions & 33 deletions packages/ui/app/src/mdx/components/callout/Callout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,85 +101,68 @@ export const Callout: FC<PropsWithChildren<Callout.Props>> = ({ intent: intentRa

// aliases

export function InfoCallout({ children, title, icon }: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
export function InfoCallout({ children, ...props }: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
return (
<Callout intent="info" title={title} icon={icon}>
<Callout intent="info" {...props}>
{children}
</Callout>
);
}

export function WarningCallout({
children,
title,
icon,
}: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
export function WarningCallout({ children, ...props }: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
return (
<Callout intent="warning" title={title} icon={icon}>
<Callout intent="warning" {...props}>
{children}
</Callout>
);
}

export function SuccessCallout({
children,
title,
icon,
}: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
export function SuccessCallout({ children, ...props }: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
return (
<Callout intent="success" title={title} icon={icon}>
<Callout intent="success" {...props}>
{children}
</Callout>
);
}

export function ErrorCallout({
children,
title,
icon,
}: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
export function ErrorCallout({ children, ...props }: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
return (
<Callout intent="error" title={title} icon={icon}>
<Callout intent="error" {...props}>
{children}
</Callout>
);
}

export function NoteCallout({ children, title, icon }: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
export function NoteCallout({ children, ...props }: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
return (
<Callout intent="note" title={title} icon={icon}>
<Callout intent="note" {...props}>
{children}
</Callout>
);
}

export function LaunchNoteCallout({
children,
title,
icon,
...props
}: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
return (
<Callout intent="launch" title={title} icon={icon}>
<Callout intent="launch" {...props}>
{children}
</Callout>
);
}

export function TipCallout({ children, title, icon }: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
export function TipCallout({ children, ...props }: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
return (
<Callout intent="tip" title={title} icon={icon}>
<Callout intent="tip" {...props}>
{children}
</Callout>
);
}

export function CheckCallout({
children,
title,
icon,
}: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
export function CheckCallout({ children, ...props }: PropsWithChildren<Omit<Callout.Props, "intent">>): ReactElement {
return (
<Callout intent="check" title={title} icon={icon}>
<Callout intent="check" {...props}>
{children}
</Callout>
);
Expand Down

0 comments on commit 0fe07b1

Please sign in to comment.