chore: typing for sidepeek components

This commit is contained in:
Chuma McPhoy
2024-07-12 14:36:13 +02:00
parent f78e74d3e3
commit f43de03d7a
3 changed files with 13 additions and 11 deletions

View File

@@ -5,6 +5,8 @@ import { Children, PropsWithChildren } from "react"
import { CloseIcon } from "@/components/Icons"
import Title from "@/components/TempDesignSystem/Text/Title"
import { SidePeekContentProps } from "./types"
import styles from "./content.module.css"
export default function Content({
@@ -13,12 +15,7 @@ export default function Content({
contentKey,
isActive = false,
onClose,
}: PropsWithChildren<{
title?: string
contentKey: string
isActive?: boolean
onClose?: () => void
}>) {
}: PropsWithChildren<SidePeekContentProps>) {
return isActive ? (
<aside className={styles.content}>
<header className={styles.header}>

View File

@@ -0,0 +1,6 @@
export type SidePeekContentProps = {
title?: string
contentKey: string
isActive?: boolean
onClose?: () => void
}

View File

@@ -5,15 +5,14 @@ import { Dialog, DialogTrigger, Modal } from "react-aria-components"
import styles from "./sidePeek.module.css"
type SidePeekProps = {
activeContent: string | null
onClose: (isOpen: boolean) => void
}
export default function SidePeek({
children,
onClose,
activeContent,
}: PropsWithChildren<SidePeekProps>) {
}: PropsWithChildren<{
onClose: (isOpen: boolean) => void
activeContent: string | null
}>) {
return (
<DialogTrigger>
<Modal