/* eslint-disable react-hooks/rules-of-hooks */ import { useRef } from "react"; import { Flex, Input, Text } from "../../../components"; import { useIsFocused } from "./index"; import type { Meta, StoryObj } from "@storybook/react"; const meta: Meta = { title: "Hooks/useIsFocused", argTypes: { ref: { control: false, description: "The ref of the Element to check focus state of.", table: { type: { summary: "React.MutableRefObject", }, }, }, }, }; export default meta; type Story = StoryObj; export const Default: Story = { render: () => { const ref = useRef(null); const { isFocused } = useIsFocused(ref); return ( Is input focused? {isFocused ? "yes" : "no"} ); }, };