Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
18 lines
397 B
TypeScript
18 lines
397 B
TypeScript
import { Signal } from "@preact/signals";
|
|
import { ComponentChildren } from "preact";
|
|
|
|
export interface IslandConditionalProps {
|
|
show: Signal<boolean>;
|
|
children?: ComponentChildren;
|
|
}
|
|
|
|
export default function IslandConditional(
|
|
{ show, children }: IslandConditionalProps,
|
|
) {
|
|
return (
|
|
<div class="island">
|
|
{show.value ? <p>island content</p> : <>{children}</>}
|
|
</div>
|
|
);
|
|
}
|