phation 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +69 -101
  2. package/package.json +13 -3
  3. package/server.json +36 -0
  4. package/animate/testset/eval.mjs +0 -24
  5. package/animate/testset/expected.json +0 -23
  6. package/animate/testset/holdout/commerce-delete-item-button.tsx +0 -38
  7. package/animate/testset/holdout/commerce-gallery.tsx +0 -96
  8. package/animate/testset/holdout/commerce-tile.tsx +0 -50
  9. package/animate/testset/holdout/shadcn-button-group-demo.tsx +0 -114
  10. package/animate/testset/holdout/shadcn-card-demo.tsx +0 -63
  11. package/animate/testset/holdout/shadcn-command-dialog.tsx +0 -87
  12. package/animate/testset/holdout/shadcn-drawer-dialog.tsx +0 -90
  13. package/animate/testset/holdout/shadcn-field-switch.tsx +0 -24
  14. package/animate/testset/holdout/shadcn-hover-card-demo.tsx +0 -40
  15. package/animate/testset/holdout/shadcn-mode-toggle.tsx +0 -40
  16. package/animate/testset/holdout/shadcn-toggle-group-demo.tsx +0 -22
  17. package/animate/testset/holdout.json +0 -14
  18. package/animate/testset/holdout2/chatbot-artifact-close-button.tsx +0 -30
  19. package/animate/testset/holdout2/chatbot-message-actions.tsx +0 -211
  20. package/animate/testset/holdout2/chatbot-sidebar-history-item.tsx +0 -132
  21. package/animate/testset/holdout2/chatbot-sidebar-toggle.tsx +0 -35
  22. package/animate/testset/holdout2/chatbot-suggested-actions.tsx +0 -82
  23. package/animate/testset/holdout2/chatbot-weather.tsx +0 -434
  24. package/animate/testset/holdout2/site-code-tabs.tsx +0 -26
  25. package/animate/testset/holdout2/site-copy-button.tsx +0 -121
  26. package/animate/testset/holdout2/site-github-link.tsx +0 -38
  27. package/animate/testset/holdout2/site-mobile-nav.tsx +0 -220
  28. package/animate/testset/holdout2/site-mode-switcher.tsx +0 -97
  29. package/animate/testset/holdout2/site-page-nav.tsx +0 -15
  30. package/animate/testset/holdout2.json +0 -15
  31. package/animate/testset/screens/commerce-cart-add-to-cart.tsx +0 -94
  32. package/animate/testset/screens/commerce-cart-modal.tsx +0 -256
  33. package/animate/testset/screens/commerce-navbar-mobile-menu.tsx +0 -104
  34. package/animate/testset/screens/commerce-product-variant-selector.tsx +0 -106
  35. package/animate/testset/screens/shadcn-accordion-demo.tsx +0 -61
  36. package/animate/testset/screens/shadcn-alert-dialog-demo.tsx +0 -35
  37. package/animate/testset/screens/shadcn-card-with-form.tsx +0 -59
  38. package/animate/testset/screens/shadcn-collapsible-demo.tsx +0 -46
  39. package/animate/testset/screens/shadcn-dialog-demo.tsx +0 -50
  40. package/animate/testset/screens/shadcn-drawer-demo.tsx +0 -136
  41. package/animate/testset/screens/shadcn-login-form.tsx +0 -71
  42. package/animate/testset/screens/shadcn-nav-main.tsx +0 -73
  43. package/animate/testset/screens/shadcn-section-cards.tsx +0 -102
  44. package/animate/testset/screens/shadcn-sheet-demo.tsx +0 -47
  45. package/animate/testset/screens/shadcn-switch-demo.tsx +0 -11
  46. package/animate/testset/screens/shadcn-tabs-demo.tsx +0 -80
  47. package/animate/testset/screens/taxonomy-main-nav.tsx +0 -61
  48. package/animate/testset/screens/taxonomy-post-item.tsx +0 -42
  49. package/animate/testset/screens/taxonomy-pricing.tsx +0 -69
  50. package/animate/testset/screens/taxonomy-user-account-nav.tsx +0 -65
@@ -1,50 +0,0 @@
1
- import { Button } from "@/registry/new-york-v4/ui/button"
2
- import {
3
- Dialog,
4
- DialogClose,
5
- DialogContent,
6
- DialogDescription,
7
- DialogFooter,
8
- DialogHeader,
9
- DialogTitle,
10
- DialogTrigger,
11
- } from "@/registry/new-york-v4/ui/dialog"
12
- import { Input } from "@/registry/new-york-v4/ui/input"
13
- import { Label } from "@/registry/new-york-v4/ui/label"
14
-
15
- export default function DialogDemo() {
16
- return (
17
- <Dialog>
18
- <form>
19
- <DialogTrigger asChild>
20
- <Button variant="outline">Open Dialog</Button>
21
- </DialogTrigger>
22
- <DialogContent className="sm:max-w-[425px]">
23
- <DialogHeader>
24
- <DialogTitle>Edit profile</DialogTitle>
25
- <DialogDescription>
26
- Make changes to your profile here. Click save when you&apos;re
27
- done.
28
- </DialogDescription>
29
- </DialogHeader>
30
- <div className="grid gap-4">
31
- <div className="grid gap-3">
32
- <Label htmlFor="name-1">Name</Label>
33
- <Input id="name-1" name="name" defaultValue="Pedro Duarte" />
34
- </div>
35
- <div className="grid gap-3">
36
- <Label htmlFor="username-1">Username</Label>
37
- <Input id="username-1" name="username" defaultValue="@peduarte" />
38
- </div>
39
- </div>
40
- <DialogFooter>
41
- <DialogClose asChild>
42
- <Button variant="outline">Cancel</Button>
43
- </DialogClose>
44
- <Button type="submit">Save changes</Button>
45
- </DialogFooter>
46
- </DialogContent>
47
- </form>
48
- </Dialog>
49
- )
50
- }
@@ -1,136 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import { Minus, Plus } from "lucide-react"
5
- import { Bar, BarChart, ResponsiveContainer } from "recharts"
6
-
7
- import { Button } from "@/registry/new-york-v4/ui/button"
8
- import {
9
- Drawer,
10
- DrawerClose,
11
- DrawerContent,
12
- DrawerDescription,
13
- DrawerFooter,
14
- DrawerHeader,
15
- DrawerTitle,
16
- DrawerTrigger,
17
- } from "@/registry/new-york-v4/ui/drawer"
18
-
19
- const data = [
20
- {
21
- goal: 400,
22
- },
23
- {
24
- goal: 300,
25
- },
26
- {
27
- goal: 200,
28
- },
29
- {
30
- goal: 300,
31
- },
32
- {
33
- goal: 200,
34
- },
35
- {
36
- goal: 278,
37
- },
38
- {
39
- goal: 189,
40
- },
41
- {
42
- goal: 239,
43
- },
44
- {
45
- goal: 300,
46
- },
47
- {
48
- goal: 200,
49
- },
50
- {
51
- goal: 278,
52
- },
53
- {
54
- goal: 189,
55
- },
56
- {
57
- goal: 349,
58
- },
59
- ]
60
-
61
- export default function DrawerDemo() {
62
- const [goal, setGoal] = React.useState(350)
63
-
64
- function onClick(adjustment: number) {
65
- setGoal(Math.max(200, Math.min(400, goal + adjustment)))
66
- }
67
-
68
- return (
69
- <Drawer>
70
- <DrawerTrigger asChild>
71
- <Button variant="outline">Open Drawer</Button>
72
- </DrawerTrigger>
73
- <DrawerContent>
74
- <div className="mx-auto w-full max-w-sm">
75
- <DrawerHeader>
76
- <DrawerTitle>Move Goal</DrawerTitle>
77
- <DrawerDescription>Set your daily activity goal.</DrawerDescription>
78
- </DrawerHeader>
79
- <div className="p-4 pb-0">
80
- <div className="flex items-center justify-center space-x-2">
81
- <Button
82
- variant="outline"
83
- size="icon"
84
- className="h-8 w-8 shrink-0 rounded-full"
85
- onClick={() => onClick(-10)}
86
- disabled={goal <= 200}
87
- >
88
- <Minus />
89
- <span className="sr-only">Decrease</span>
90
- </Button>
91
- <div className="flex-1 text-center">
92
- <div className="text-7xl font-bold tracking-tighter">
93
- {goal}
94
- </div>
95
- <div className="text-[0.70rem] text-muted-foreground uppercase">
96
- Calories/day
97
- </div>
98
- </div>
99
- <Button
100
- variant="outline"
101
- size="icon"
102
- className="h-8 w-8 shrink-0 rounded-full"
103
- onClick={() => onClick(10)}
104
- disabled={goal >= 400}
105
- >
106
- <Plus />
107
- <span className="sr-only">Increase</span>
108
- </Button>
109
- </div>
110
- <div className="mt-3 h-[120px]">
111
- <ResponsiveContainer width="100%" height="100%">
112
- <BarChart data={data}>
113
- <Bar
114
- dataKey="goal"
115
- style={
116
- {
117
- fill: "hsl(var(--foreground))",
118
- opacity: 0.9,
119
- } as React.CSSProperties
120
- }
121
- />
122
- </BarChart>
123
- </ResponsiveContainer>
124
- </div>
125
- </div>
126
- <DrawerFooter>
127
- <Button>Submit</Button>
128
- <DrawerClose asChild>
129
- <Button variant="outline">Cancel</Button>
130
- </DrawerClose>
131
- </DrawerFooter>
132
- </div>
133
- </DrawerContent>
134
- </Drawer>
135
- )
136
- }
@@ -1,71 +0,0 @@
1
- import { cn } from "cn"
2
-
3
- import { Button } from "@/registry/new-york-v4/ui/button"
4
- import {
5
- Card,
6
- CardContent,
7
- CardDescription,
8
- CardHeader,
9
- CardTitle,
10
- } from "@/registry/new-york-v4/ui/card"
11
- import {
12
- Field,
13
- FieldDescription,
14
- FieldGroup,
15
- FieldLabel,
16
- } from "@/registry/new-york-v4/ui/field"
17
- import { Input } from "@/registry/new-york-v4/ui/input"
18
-
19
- export function LoginForm({
20
- className,
21
- ...props
22
- }: React.ComponentProps<"div">) {
23
- return (
24
- <div className={cn("flex flex-col gap-6", className)} {...props}>
25
- <Card>
26
- <CardHeader>
27
- <CardTitle>Login to your account</CardTitle>
28
- <CardDescription>
29
- Enter your email below to login to your account
30
- </CardDescription>
31
- </CardHeader>
32
- <CardContent>
33
- <form>
34
- <FieldGroup>
35
- <Field>
36
- <FieldLabel htmlFor="email">Email</FieldLabel>
37
- <Input
38
- id="email"
39
- type="email"
40
- placeholder="m@example.com"
41
- required
42
- />
43
- </Field>
44
- <Field>
45
- <div className="flex items-center">
46
- <FieldLabel htmlFor="password">Password</FieldLabel>
47
- <a
48
- href="#"
49
- className="ml-auto inline-block text-sm underline-offset-4 hover:underline"
50
- >
51
- Forgot your password?
52
- </a>
53
- </div>
54
- <Input id="password" type="password" required />
55
- </Field>
56
- <Field>
57
- <Button type="submit">Login</Button>
58
- <Button variant="outline" type="button">
59
- Login with Google
60
- </Button>
61
- <FieldDescription className="text-center">
62
- Don&apos;t have an account? <a href="#">Sign up</a>
63
- </FieldDescription>
64
- </Field>
65
- </FieldGroup>
66
- </form>
67
- </CardContent>
68
- </Card>
69
- </div>
70
- )
71
- }
@@ -1,73 +0,0 @@
1
- "use client"
2
-
3
- import { ChevronRight, type LucideIcon } from "lucide-react"
4
-
5
- import {
6
- Collapsible,
7
- CollapsibleContent,
8
- CollapsibleTrigger,
9
- } from "@/registry/new-york-v4/ui/collapsible"
10
- import {
11
- SidebarGroup,
12
- SidebarGroupLabel,
13
- SidebarMenu,
14
- SidebarMenuButton,
15
- SidebarMenuItem,
16
- SidebarMenuSub,
17
- SidebarMenuSubButton,
18
- SidebarMenuSubItem,
19
- } from "@/registry/new-york-v4/ui/sidebar"
20
-
21
- export function NavMain({
22
- items,
23
- }: {
24
- items: {
25
- title: string
26
- url: string
27
- icon?: LucideIcon
28
- isActive?: boolean
29
- items?: {
30
- title: string
31
- url: string
32
- }[]
33
- }[]
34
- }) {
35
- return (
36
- <SidebarGroup>
37
- <SidebarGroupLabel>Platform</SidebarGroupLabel>
38
- <SidebarMenu>
39
- {items.map((item) => (
40
- <Collapsible
41
- key={item.title}
42
- asChild
43
- defaultOpen={item.isActive}
44
- className="group/collapsible"
45
- >
46
- <SidebarMenuItem>
47
- <CollapsibleTrigger asChild>
48
- <SidebarMenuButton tooltip={item.title}>
49
- {item.icon && <item.icon />}
50
- <span>{item.title}</span>
51
- <ChevronRight className="ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" />
52
- </SidebarMenuButton>
53
- </CollapsibleTrigger>
54
- <CollapsibleContent>
55
- <SidebarMenuSub>
56
- {item.items?.map((subItem) => (
57
- <SidebarMenuSubItem key={subItem.title}>
58
- <SidebarMenuSubButton asChild>
59
- <a href={subItem.url}>
60
- <span>{subItem.title}</span>
61
- </a>
62
- </SidebarMenuSubButton>
63
- </SidebarMenuSubItem>
64
- ))}
65
- </SidebarMenuSub>
66
- </CollapsibleContent>
67
- </SidebarMenuItem>
68
- </Collapsible>
69
- ))}
70
- </SidebarMenu>
71
- </SidebarGroup>
72
- )
73
- }
@@ -1,102 +0,0 @@
1
- import { IconTrendingDown, IconTrendingUp } from "@tabler/icons-react"
2
-
3
- import { Badge } from "@/registry/new-york-v4/ui/badge"
4
- import {
5
- Card,
6
- CardAction,
7
- CardDescription,
8
- CardFooter,
9
- CardHeader,
10
- CardTitle,
11
- } from "@/registry/new-york-v4/ui/card"
12
-
13
- export function SectionCards() {
14
- return (
15
- <div className="grid grid-cols-1 gap-4 px-4 *:data-[slot=card]:bg-gradient-to-t *:data-[slot=card]:from-primary/5 *:data-[slot=card]:to-card *:data-[slot=card]:shadow-xs lg:px-6 @xl/main:grid-cols-2 @5xl/main:grid-cols-4 dark:*:data-[slot=card]:bg-card">
16
- <Card className="@container/card">
17
- <CardHeader>
18
- <CardDescription>Total Revenue</CardDescription>
19
- <CardTitle className="text-2xl font-semibold tabular-nums @[250px]/card:text-3xl">
20
- $1,250.00
21
- </CardTitle>
22
- <CardAction>
23
- <Badge variant="outline">
24
- <IconTrendingUp />
25
- +12.5%
26
- </Badge>
27
- </CardAction>
28
- </CardHeader>
29
- <CardFooter className="flex-col items-start gap-1.5 text-sm">
30
- <div className="line-clamp-1 flex gap-2 font-medium">
31
- Trending up this month <IconTrendingUp className="size-4" />
32
- </div>
33
- <div className="text-muted-foreground">
34
- Visitors for the last 6 months
35
- </div>
36
- </CardFooter>
37
- </Card>
38
- <Card className="@container/card">
39
- <CardHeader>
40
- <CardDescription>New Customers</CardDescription>
41
- <CardTitle className="text-2xl font-semibold tabular-nums @[250px]/card:text-3xl">
42
- 1,234
43
- </CardTitle>
44
- <CardAction>
45
- <Badge variant="outline">
46
- <IconTrendingDown />
47
- -20%
48
- </Badge>
49
- </CardAction>
50
- </CardHeader>
51
- <CardFooter className="flex-col items-start gap-1.5 text-sm">
52
- <div className="line-clamp-1 flex gap-2 font-medium">
53
- Down 20% this period <IconTrendingDown className="size-4" />
54
- </div>
55
- <div className="text-muted-foreground">
56
- Acquisition needs attention
57
- </div>
58
- </CardFooter>
59
- </Card>
60
- <Card className="@container/card">
61
- <CardHeader>
62
- <CardDescription>Active Accounts</CardDescription>
63
- <CardTitle className="text-2xl font-semibold tabular-nums @[250px]/card:text-3xl">
64
- 45,678
65
- </CardTitle>
66
- <CardAction>
67
- <Badge variant="outline">
68
- <IconTrendingUp />
69
- +12.5%
70
- </Badge>
71
- </CardAction>
72
- </CardHeader>
73
- <CardFooter className="flex-col items-start gap-1.5 text-sm">
74
- <div className="line-clamp-1 flex gap-2 font-medium">
75
- Strong user retention <IconTrendingUp className="size-4" />
76
- </div>
77
- <div className="text-muted-foreground">Engagement exceed targets</div>
78
- </CardFooter>
79
- </Card>
80
- <Card className="@container/card">
81
- <CardHeader>
82
- <CardDescription>Growth Rate</CardDescription>
83
- <CardTitle className="text-2xl font-semibold tabular-nums @[250px]/card:text-3xl">
84
- 4.5%
85
- </CardTitle>
86
- <CardAction>
87
- <Badge variant="outline">
88
- <IconTrendingUp />
89
- +4.5%
90
- </Badge>
91
- </CardAction>
92
- </CardHeader>
93
- <CardFooter className="flex-col items-start gap-1.5 text-sm">
94
- <div className="line-clamp-1 flex gap-2 font-medium">
95
- Steady performance increase <IconTrendingUp className="size-4" />
96
- </div>
97
- <div className="text-muted-foreground">Meets growth projections</div>
98
- </CardFooter>
99
- </Card>
100
- </div>
101
- )
102
- }
@@ -1,47 +0,0 @@
1
- import { Button } from "@/registry/new-york-v4/ui/button"
2
- import { Input } from "@/registry/new-york-v4/ui/input"
3
- import { Label } from "@/registry/new-york-v4/ui/label"
4
- import {
5
- Sheet,
6
- SheetClose,
7
- SheetContent,
8
- SheetDescription,
9
- SheetFooter,
10
- SheetHeader,
11
- SheetTitle,
12
- SheetTrigger,
13
- } from "@/registry/new-york-v4/ui/sheet"
14
-
15
- export default function SheetDemo() {
16
- return (
17
- <Sheet>
18
- <SheetTrigger asChild>
19
- <Button variant="outline">Open</Button>
20
- </SheetTrigger>
21
- <SheetContent>
22
- <SheetHeader>
23
- <SheetTitle>Edit profile</SheetTitle>
24
- <SheetDescription>
25
- Make changes to your profile here. Click save when you&apos;re done.
26
- </SheetDescription>
27
- </SheetHeader>
28
- <div className="grid flex-1 auto-rows-min gap-6 px-4">
29
- <div className="grid gap-3">
30
- <Label htmlFor="sheet-demo-name">Name</Label>
31
- <Input id="sheet-demo-name" defaultValue="Pedro Duarte" />
32
- </div>
33
- <div className="grid gap-3">
34
- <Label htmlFor="sheet-demo-username">Username</Label>
35
- <Input id="sheet-demo-username" defaultValue="@peduarte" />
36
- </div>
37
- </div>
38
- <SheetFooter>
39
- <Button type="submit">Save changes</Button>
40
- <SheetClose asChild>
41
- <Button variant="outline">Close</Button>
42
- </SheetClose>
43
- </SheetFooter>
44
- </SheetContent>
45
- </Sheet>
46
- )
47
- }
@@ -1,11 +0,0 @@
1
- import { Label } from "@/registry/new-york-v4/ui/label"
2
- import { Switch } from "@/registry/new-york-v4/ui/switch"
3
-
4
- export default function SwitchDemo() {
5
- return (
6
- <div className="flex items-center space-x-2">
7
- <Switch id="airplane-mode" />
8
- <Label htmlFor="airplane-mode">Airplane Mode</Label>
9
- </div>
10
- )
11
- }
@@ -1,80 +0,0 @@
1
- import { AppWindowIcon, CodeIcon } from "lucide-react"
2
-
3
- import { Button } from "@/registry/new-york-v4/ui/button"
4
- import {
5
- Card,
6
- CardContent,
7
- CardDescription,
8
- CardFooter,
9
- CardHeader,
10
- CardTitle,
11
- } from "@/registry/new-york-v4/ui/card"
12
- import { Input } from "@/registry/new-york-v4/ui/input"
13
- import { Label } from "@/registry/new-york-v4/ui/label"
14
- import {
15
- Tabs,
16
- TabsContent,
17
- TabsList,
18
- TabsTrigger,
19
- } from "@/registry/new-york-v4/ui/tabs"
20
-
21
- export default function TabsDemo() {
22
- return (
23
- <div className="flex w-full max-w-sm flex-col gap-6">
24
- <Tabs defaultValue="account">
25
- <TabsList>
26
- <TabsTrigger value="account">Account</TabsTrigger>
27
- <TabsTrigger value="password">Password</TabsTrigger>
28
- </TabsList>
29
- <TabsContent value="account">
30
- <Card>
31
- <CardHeader>
32
- <CardTitle>Account</CardTitle>
33
- <CardDescription>
34
- Make changes to your account here. Click save when you&apos;re
35
- done.
36
- </CardDescription>
37
- </CardHeader>
38
- <CardContent className="grid gap-6">
39
- <div className="grid gap-3">
40
- <Label htmlFor="tabs-demo-name">Name</Label>
41
- <Input id="tabs-demo-name" defaultValue="Pedro Duarte" />
42
- </div>
43
- <div className="grid gap-3">
44
- <Label htmlFor="tabs-demo-username">Username</Label>
45
- <Input id="tabs-demo-username" defaultValue="@peduarte" />
46
- </div>
47
- </CardContent>
48
- <CardFooter>
49
- <Button>Save changes</Button>
50
- </CardFooter>
51
- </Card>
52
- </TabsContent>
53
- <TabsContent value="password">
54
- <Card>
55
- <CardHeader>
56
- <CardTitle>Password</CardTitle>
57
- <CardDescription>
58
- Change your password here. After saving, you&apos;ll be logged
59
- out.
60
- </CardDescription>
61
- </CardHeader>
62
- <CardContent className="grid gap-6">
63
- <div className="grid gap-3">
64
- <Label htmlFor="tabs-demo-current">Current password</Label>
65
- <Input id="tabs-demo-current" type="password" />
66
- </div>
67
- <div className="grid gap-3">
68
- <Label htmlFor="tabs-demo-new">New password</Label>
69
- <Input id="tabs-demo-new" type="password" />
70
- </div>
71
- </CardContent>
72
- <CardFooter>
73
- <Button>Save password</Button>
74
- </CardFooter>
75
- </Card>
76
- </TabsContent>
77
- </Tabs>
78
- </div>
79
- )
80
- }
@@ -1,61 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import Link from "next/link"
5
- import { useSelectedLayoutSegment } from "next/navigation"
6
-
7
- import { MainNavItem } from "types"
8
- import { siteConfig } from "@/config/site"
9
- import { cn } from "@/lib/utils"
10
- import { Icons } from "@/components/icons"
11
- import { MobileNav } from "@/components/mobile-nav"
12
-
13
- interface MainNavProps {
14
- items?: MainNavItem[]
15
- children?: React.ReactNode
16
- }
17
-
18
- export function MainNav({ items, children }: MainNavProps) {
19
- const segment = useSelectedLayoutSegment()
20
- const [showMobileMenu, setShowMobileMenu] = React.useState<boolean>(false)
21
-
22
- return (
23
- <div className="flex gap-6 md:gap-10">
24
- <Link href="/" className="hidden items-center space-x-2 md:flex">
25
- <Icons.logo />
26
- <span className="hidden font-bold sm:inline-block">
27
- {siteConfig.name}
28
- </span>
29
- </Link>
30
- {items?.length ? (
31
- <nav className="hidden gap-6 md:flex">
32
- {items?.map((item, index) => (
33
- <Link
34
- key={index}
35
- href={item.disabled ? "#" : item.href}
36
- className={cn(
37
- "flex items-center text-lg font-medium transition-colors hover:text-foreground/80 sm:text-sm",
38
- item.href.startsWith(`/${segment}`)
39
- ? "text-foreground"
40
- : "text-foreground/60",
41
- item.disabled && "cursor-not-allowed opacity-80"
42
- )}
43
- >
44
- {item.title}
45
- </Link>
46
- ))}
47
- </nav>
48
- ) : null}
49
- <button
50
- className="flex items-center space-x-2 md:hidden"
51
- onClick={() => setShowMobileMenu(!showMobileMenu)}
52
- >
53
- {showMobileMenu ? <Icons.close /> : <Icons.logo />}
54
- <span className="font-bold">Menu</span>
55
- </button>
56
- {showMobileMenu && items && (
57
- <MobileNav items={items}>{children}</MobileNav>
58
- )}
59
- </div>
60
- )
61
- }
@@ -1,42 +0,0 @@
1
- import Link from "next/link"
2
- import { Post } from "@prisma/client"
3
-
4
- import { formatDate } from "@/lib/utils"
5
- import { Skeleton } from "@/components/ui/skeleton"
6
- import { PostOperations } from "@/components/post-operations"
7
-
8
- interface PostItemProps {
9
- post: Pick<Post, "id" | "title" | "published" | "createdAt">
10
- }
11
-
12
- export function PostItem({ post }: PostItemProps) {
13
- return (
14
- <div className="flex items-center justify-between p-4">
15
- <div className="grid gap-1">
16
- <Link
17
- href={`/editor/${post.id}`}
18
- className="font-semibold hover:underline"
19
- >
20
- {post.title}
21
- </Link>
22
- <div>
23
- <p className="text-sm text-muted-foreground">
24
- {formatDate(post.createdAt?.toDateString())}
25
- </p>
26
- </div>
27
- </div>
28
- <PostOperations post={{ id: post.id, title: post.title }} />
29
- </div>
30
- )
31
- }
32
-
33
- PostItem.Skeleton = function PostItemSkeleton() {
34
- return (
35
- <div className="p-4">
36
- <div className="space-y-3">
37
- <Skeleton className="h-5 w-2/5" />
38
- <Skeleton className="h-4 w-4/5" />
39
- </div>
40
- </div>
41
- )
42
- }