diff --git a/src/App.tsx b/src/App.tsx index 69a2c3b..4042a16 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,7 +1,7 @@ import { useState } from 'react'; import { ShoppingCart } from 'lucide-react'; import { Sheet, SheetTrigger } from '@/components/ui/sheet'; -import Cart from './components/Cart'; +import Cart from './components/Card'; import Product from './components/Product'; import CartContext from './lib/context'; import useTheme from './hooks/useTheme'; @@ -14,25 +14,24 @@ function App() { return ( -
- -
- +
+ +
+ {count} - +
-
- +
+
-
diff --git a/src/components/Card.tsx b/src/components/Card.tsx new file mode 100644 index 0000000..ef5884b --- /dev/null +++ b/src/components/Card.tsx @@ -0,0 +1,16 @@ +type cardProps = { + text?:string + time:number +} + + +export default function Card({text} :cardProps) { +// if (text){ +// const title = text + "title" +// } + + return
{text ?

+ {text} +

:null} +
; +} diff --git a/src/components/Cart.tsx b/src/components/Cart.tsx deleted file mode 100644 index e2cb91a..0000000 --- a/src/components/Cart.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { - SheetContent, - SheetHeader, - SheetTitle, - SheetDescription, -} from './ui/sheet'; - -export default function Cart({ - quantity, - setCount, -}: { - quantity: number; - setCount: React.Dispatch>; -}) { - return ( - - - Cart - - {quantity > 0 ? ( -

You have {quantity} items in your cart.

- ) : ( -

Your cart is empty.

- )} -
-
- -
- -
-
- ); -} diff --git a/src/stories/Card.stories.ts b/src/stories/Card.stories.ts new file mode 100644 index 0000000..81dc90d --- /dev/null +++ b/src/stories/Card.stories.ts @@ -0,0 +1,17 @@ +import type { Meta, StoryObj } from '@storybook/react-vite'; + +import Card from '@/components/Card'; + +const meta = { + component: Card, +} satisfies Meta; + +export default meta; +type Story = StoryObj; + +export const Primary: Story = { + args: { + text: 'Card Title', + time: 10, + }, +};