This commit is contained in:
2025-07-13 02:46:13 +09:00
parent fdf242c060
commit 0c46cf28db
29 changed files with 509 additions and 456 deletions
+2 -2
View File
@@ -5,13 +5,13 @@ type TabProps = { name: string
init?: boolean
children: React.ReactNode }
type Props = { children: React.ReactElement<TabProps>[] }
type Props = { children: React.ReactNode }
export const Tab = ({ children }: TabProps) => <>{children}</>
export default ({ children }: Props) => {
const tabs = React.Children.toArray (children)
const tabs = React.Children.toArray (children) as React.ReactElement<TabProps>[]
const [current, setCurrent] = useState<number> (() => {
const i = tabs.findIndex (tab => tab.props.init)