mirror of
https://github.com/revanced/revanced-website.git
synced 2025-05-25 11:02:17 +02:00
fix: correctly type props
This commit is contained in:
parent
485ac26c30
commit
9dc01dbfc4
@ -11,9 +11,17 @@
|
|||||||
type Props = {
|
type Props = {
|
||||||
children: Snippet;
|
children: Snippet;
|
||||||
level: 'info' | 'warning' | 'caution';
|
level: 'info' | 'warning' | 'caution';
|
||||||
permanent?: boolean;
|
} & (
|
||||||
onDismiss?: () => void;
|
| {
|
||||||
};
|
permanent?: false;
|
||||||
|
onDismiss?: () => void;
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
permanent: true;
|
||||||
|
onDismiss?: never; // permanent banner doesn't have a dismiss button
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
let { children, level = 'info', permanent = false, onDismiss }: Props = $props();
|
let { children, level = 'info', permanent = false, onDismiss }: Props = $props();
|
||||||
|
|
||||||
const icons = { info: Info, warning: Warning, caution: Caution };
|
const icons = { info: Info, warning: Warning, caution: Caution };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user