diff --git a/src/app/api/assistant-v2/route.ts b/src/app/api/assistant-v2/route.ts index 0abe303..dfef4fd 100644 --- a/src/app/api/assistant-v2/route.ts +++ b/src/app/api/assistant-v2/route.ts @@ -2,6 +2,8 @@ import { openai } from '@ai-sdk/openai'; import { convertToCoreMessages, streamText } from 'ai'; import { z } from 'zod'; +import { getPersonName } from '@/app/api/assistant-v2/tools/get-person-name'; + // Allow streaming responses up to 30 seconds export const maxDuration = 30; @@ -13,16 +15,14 @@ export async function POST(req: Request) { messages: convertToCoreMessages(messages), tools: { // server-side tool with execute function: - getWeatherInformation: { - description: 'show the weather in a given city to the user', - parameters: z.object({ city: z.string() }), - // eslint-disable-next-line no-empty-pattern - execute: async ({}: { city: string }) => { - const weatherOptions = ['sunny', 'cloudy', 'rainy', 'snowy', 'windy']; - return weatherOptions[ - Math.floor(Math.random() * weatherOptions.length) - ]; - }, + getPersonName: { + description: "Parse the string to extract the user's name.", + parameters: z.object({ + message: z + .string() + .describe('The message from which to extract the name.'), + }), + execute: getPersonName, }, // client-side tool that starts user interaction: askForConfirmation: { @@ -42,3 +42,41 @@ export async function POST(req: Request) { return result.toDataStreamResponse(); } + +// export async function POST(req: Request) { +// const { messages } = await req.json(); + +// const result = await streamText({ +// model: openai('gpt-4-turbo'), +// messages: convertToCoreMessages(messages), +// tools: { +// // server-side tool with execute function: +// getWeatherInformation: { +// description: 'show the weather in a given city to the user', +// parameters: z.object({ city: z.string() }), +// // eslint-disable-next-line no-empty-pattern +// execute: async ({}: { city: string }) => { +// const weatherOptions = ['sunny', 'cloudy', 'rainy', 'snowy', 'windy']; +// return weatherOptions[ +// Math.floor(Math.random() * weatherOptions.length) +// ]; +// }, +// }, +// // client-side tool that starts user interaction: +// askForConfirmation: { +// description: 'Ask the user for confirmation.', +// parameters: z.object({ +// message: z.string().describe('The message to ask for confirmation.'), +// }), +// }, +// // client-side tool that is automatically executed on the client: +// getLocation: { +// description: +// 'Get the user location. Always ask for confirmation before using this tool.', +// parameters: z.object({}), +// }, +// }, +// }); + +// return result.toDataStreamResponse(); +// } diff --git a/src/app/api/assistant-v2/tools/get-person-name.ts b/src/app/api/assistant-v2/tools/get-person-name.ts new file mode 100644 index 0000000..bf82094 --- /dev/null +++ b/src/app/api/assistant-v2/tools/get-person-name.ts @@ -0,0 +1,38 @@ +import OpenAI from 'openai'; + +import logger from '@/lib/logger'; + +const openai = new OpenAI({ + apiKey: process.env.OPENAI_API_KEY, +}); + +interface Props { + message: string; +} +export const getPersonName = async ({ message }: Props) => { + const response = await openai.chat.completions.create({ + model: 'gpt-3.5-turbo', + messages: [ + { + role: 'system', + content: + "You are a string parser. You will be given a string that contains a person's name. You have to extract the name from the string. Only return the name and nothing else.", + }, + { + role: 'user', + content: message, + }, + ], + temperature: 0.7, + max_tokens: 64, + top_p: 1, + }); + + const name = response.choices[0].message.content; + if (!name) { + logger('Response: ', JSON.stringify(response)); + throw new Error('Name not found'); + } + logger(`Got user ${name}`); + return name; +}; diff --git a/src/app/api/employees/route.ts b/src/app/api/employees/route.ts deleted file mode 100644 index 43d0f6a..0000000 --- a/src/app/api/employees/route.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { NextResponse } from 'next/server'; - -export async function GET() { - const employees = [ - { id: 1, name: 'John Doe' }, - { id: 2, name: 'Jane Doe' }, - ]; - return NextResponse.json(employees); -} - -export async function POST() { - return NextResponse.json({ hello: 'Next.js' }); -} diff --git a/src/app/assistant/components/chat/chat-bottombar.tsx b/src/app/assistant/components/chat/chat-bottombar.tsx index a71928d..dfa2f86 100644 --- a/src/app/assistant/components/chat/chat-bottombar.tsx +++ b/src/app/assistant/components/chat/chat-bottombar.tsx @@ -5,57 +5,40 @@ import { Paperclip, PlusCircle, SendHorizontal, - ThumbsUp, } from 'lucide-react'; import Link from 'next/link'; import React, { useRef, useState } from 'react'; import { cn } from '@/lib/utils'; -import { loggedInUserData, Message } from '@/app/data'; - -import { buttonVariants } from '../ui/button'; +import { Button, buttonVariants } from '../ui/button'; import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover'; import { Textarea } from '../ui/textarea'; interface ChatBottombarProps { - sendMessage: (newMessage: Message) => void; isMobile: boolean; + handleInputChange: (event: React.ChangeEvent) => void; + handleSubmit: (event: React.FormEvent) => void; } export const BottombarIcons = [{ icon: FileImage }, { icon: Paperclip }]; export default function ChatBottombar({ - sendMessage, + handleSubmit, isMobile, + ...props }: ChatBottombarProps) { const [message, setMessage] = useState(''); const inputRef = useRef(null); const handleInputChange = (event: React.ChangeEvent) => { + props.handleInputChange(event); setMessage(event.target.value); }; - const handleThumbsUp = () => { - const newMessage: Message = { - id: message.length + 1, - name: loggedInUserData.name, - avatar: loggedInUserData.avatar, - message: '👍', - }; - sendMessage(newMessage); - setMessage(''); - }; - - const handleSend = () => { + const handleSend = (e: React.FormEvent) => { if (message.trim()) { - const newMessage: Message = { - id: message.length + 1, - name: loggedInUserData.name, - avatar: loggedInUserData.avatar, - message: message.trim(), - }; - sendMessage(newMessage); + handleSubmit(e); setMessage(''); if (inputRef.current) { @@ -65,10 +48,10 @@ export default function ChatBottombar({ }; const handleKeyPress = (event: React.KeyboardEvent) => { - if (event.key === 'Enter' && !event.shiftKey) { - event.preventDefault(); - handleSend(); - } + // if (event.key === 'Enter' && !event.shiftKey) { + // event.preventDefault(); + // handleSend(); + // } if (event.key === 'Enter' && event.shiftKey) { event.preventDefault(); @@ -153,7 +136,9 @@ export default function ChatBottombar({ - -
-
emoji picker
-
-
+ - {message.trim() ? ( - - - ) : ( - - - + )}
diff --git a/src/app/assistant/components/chat/chat-layout.tsx b/src/app/assistant/components/chat/chat-layout.tsx deleted file mode 100644 index abde702..0000000 --- a/src/app/assistant/components/chat/chat-layout.tsx +++ /dev/null @@ -1,104 +0,0 @@ -'use client'; - -import React, { useEffect, useState } from 'react'; - -import { cn } from '@/lib/utils'; - -import { - ResizableHandle, - ResizablePanel, - ResizablePanelGroup, -} from '@/components/ui/resizable'; - -import { userData } from '@/app/data'; - -import { Chat } from './chat'; -import { Sidebar } from '../sidebar'; - -interface ChatLayoutProps { - defaultLayout?: number[] | undefined; - defaultCollapsed?: boolean; - navCollapsedSize: number; -} - -export function ChatLayout({ - defaultLayout = [320, 480], - defaultCollapsed = false, - navCollapsedSize, -}: ChatLayoutProps) { - const [isCollapsed, setIsCollapsed] = React.useState(defaultCollapsed); - const [selectedUser, setSelectedUser] = React.useState(userData[0]); - const [isMobile, setIsMobile] = useState(false); - - useEffect(() => { - const checkScreenWidth = () => { - setIsMobile(window.innerWidth <= 768); - }; - - // Initial check - checkScreenWidth(); - - // Event listener for screen width changes - window.addEventListener('resize', checkScreenWidth); - - // Cleanup the event listener on component unmount - return () => { - window.removeEventListener('resize', checkScreenWidth); - }; - }, []); - - return ( - { - document.cookie = `react-resizable-panels:layout=${JSON.stringify( - sizes - )}`; - }} - className='h-full items-stretch' - > - { - setIsCollapsed(true); - document.cookie = `react-resizable-panels:collapsed=${JSON.stringify( - true - )}`; - }} - onExpand={() => { - setIsCollapsed(false); - document.cookie = `react-resizable-panels:collapsed=${JSON.stringify( - false - )}`; - }} - className={cn( - isCollapsed && - 'min-w-[50px] md:min-w-[70px] transition-all duration-300 ease-in-out' - )} - > - ({ - name: user.name, - messages: user.messages ?? [], - avatar: user.avatar, - variant: selectedUser.name === user.name ? 'grey' : 'ghost', - }))} - isMobile={isMobile} - /> - - - - - - - ); -} diff --git a/src/app/assistant/components/chat/chat-list.tsx b/src/app/assistant/components/chat/chat-list.tsx index e62c3d7..6fbcf01 100644 --- a/src/app/assistant/components/chat/chat-list.tsx +++ b/src/app/assistant/components/chat/chat-list.tsx @@ -1,22 +1,24 @@ -import { Message, UserData } from '@/app/data'; -import { cn } from '@/lib/utils'; +import { AnimatePresence, motion } from 'framer-motion'; import React, { useRef } from 'react'; -import { Avatar, AvatarImage } from '../ui/avatar'; + +import { cn } from '@/lib/utils'; + +import { Message } from '@/app/data'; + import ChatBottombar from './chat-bottombar'; -import { AnimatePresence, motion } from 'framer-motion'; interface ChatListProps { messages?: Message[]; - selectedUser: UserData; - sendMessage: (newMessage: Message) => void; isMobile: boolean; + handleInputChange: (event: React.ChangeEvent) => void; + handleSubmit: (event: React.FormEvent) => void; } export function ChatList({ messages, - selectedUser, - sendMessage, + handleSubmit, isMobile, + ...props }: ChatListProps) { const messagesContainerRef = useRef(null); @@ -55,24 +57,24 @@ export function ChatList({ }} className={cn( 'flex flex-col gap-2 p-4 whitespace-pre-wrap', - message.name !== selectedUser.name ? 'items-end' : 'items-start' + message.role === 'user' ? 'items-end' : 'items-start' )} >
- {message.name === selectedUser.name && ( + {/* {message.name === selectedUser.name && ( - )} + )} */} - {message.message} + {message.content} - {message.name !== selectedUser.name && ( + {/* {message.name !== selectedUser.name && ( - )} + )} */}
))} - + ); } diff --git a/src/app/assistant/components/chat/chat-topbar.tsx b/src/app/assistant/components/chat/chat-topbar.tsx index 12b7c0f..b087855 100644 --- a/src/app/assistant/components/chat/chat-topbar.tsx +++ b/src/app/assistant/components/chat/chat-topbar.tsx @@ -1,33 +1,30 @@ -import React from 'react'; -import { Avatar, AvatarImage } from '../ui/avatar'; -import { UserData } from '@/app/data'; import { Info, Phone, Video } from 'lucide-react'; import Link from 'next/link'; +import React from 'react'; + import { cn } from '@/lib/utils'; -import { buttonVariants } from '../ui/button'; -interface ChatTopbarProps { - selectedUser: UserData; -} +import { Avatar, AvatarImage } from '../ui/avatar'; +import { buttonVariants } from '../ui/button'; export const TopbarIcons = [{ icon: Phone }, { icon: Video }, { icon: Info }]; -export default function ChatTopbar({ selectedUser }: ChatTopbarProps) { +export default function ChatTopbar() { return (
- {selectedUser.name} - Active 2 mins ago + Corporate Phonebook + Active
diff --git a/src/app/assistant/components/chat/chat.tsx b/src/app/assistant/components/chat/chat.tsx deleted file mode 100644 index a59f0a6..0000000 --- a/src/app/assistant/components/chat/chat.tsx +++ /dev/null @@ -1,33 +0,0 @@ -import { Message, UserData } from '@/app/data'; -import ChatTopbar from './chat-topbar'; -import { ChatList } from './chat-list'; -import React from 'react'; - -interface ChatProps { - messages?: Message[]; - selectedUser: UserData; - isMobile: boolean; -} - -export function Chat({ messages, selectedUser, isMobile }: ChatProps) { - const [messagesState, setMessages] = React.useState( - messages ?? [] - ); - - const sendMessage = (newMessage: Message) => { - setMessages([...messagesState, newMessage]); - }; - - return ( -
- - - -
- ); -} diff --git a/src/app/assistant/page.tsx b/src/app/assistant/page.tsx index 4853e03..409bbc1 100644 --- a/src/app/assistant/page.tsx +++ b/src/app/assistant/page.tsx @@ -203,7 +203,8 @@ import { useChat } from 'ai/react'; -import { ChatLayout } from '@/app/assistant/components/chat/chat-layout'; +import { ChatList } from '@/app/assistant/components/chat/chat-list'; +import ChatTopbar from '@/app/assistant/components/chat/chat-topbar'; export default function Page() { const { messages, input, handleInputChange, handleSubmit, addToolResult } = @@ -227,21 +228,20 @@ export default function Page() { return (
- {/*
- shadcn-chat - - - -
*/} - +
+        {JSON.stringify(messages, null, 2)}
+      
- +
+ + + Boolean(x.content))} + handleSubmit={handleSubmit} + handleInputChange={handleInputChange} + isMobile={false} + /> +
); diff --git a/src/app/data.tsx b/src/app/data.tsx index bea66af..168f048 100644 --- a/src/app/data.tsx +++ b/src/app/data.tsx @@ -1,3 +1,5 @@ +import type { Message as MessageType } from '@ai-sdk/react'; + export const userData = [ { id: 1, @@ -88,12 +90,7 @@ export const loggedInUserData = { export type LoggedInUserData = typeof loggedInUserData; -export interface Message { - id: number; - avatar: string; - name: string; - message: string; -} +export type Message = MessageType; export interface User { id: number; diff --git a/src/app/employees/components/columns.tsx b/src/app/employees/components/columns.tsx deleted file mode 100644 index 8d85ac9..0000000 --- a/src/app/employees/components/columns.tsx +++ /dev/null @@ -1,123 +0,0 @@ -'use client'; - -import { ColumnDef } from '@tanstack/react-table'; - -import { Badge } from '@/components/ui/badge'; -import { Checkbox } from '@/components/ui/checkbox'; - -import { labels, priorities, statuses } from '../data/data'; -import { Task } from '../data/schema'; -import { DataTableColumnHeader } from './data-table-column-header'; -import { DataTableRowActions } from './data-table-row-actions'; - -export const columns: ColumnDef[] = [ - { - id: 'select', - header: ({ table }) => ( - table.toggleAllPageRowsSelected(!!value)} - aria-label='Select all' - className='translate-y-[2px]' - /> - ), - cell: ({ row }) => ( - row.toggleSelected(!!value)} - aria-label='Select row' - className='translate-y-[2px]' - /> - ), - enableSorting: false, - enableHiding: false, - }, - { - accessorKey: 'id', - header: ({ column }) => ( - - ), - cell: ({ row }) =>
{row.getValue('id')}
, - enableSorting: false, - enableHiding: false, - }, - { - accessorKey: 'title', - header: ({ column }) => ( - - ), - cell: ({ row }) => { - const label = labels.find((label) => label.value === row.original.label); - - return ( -
- {label && {label.label}} - - {row.getValue('title')} - -
- ); - }, - }, - { - accessorKey: 'status', - header: ({ column }) => ( - - ), - cell: ({ row }) => { - const status = statuses.find( - (status) => status.value === row.getValue('status') - ); - - if (!status) { - return null; - } - - return ( -
- {status.icon && ( - - )} - {status.label} -
- ); - }, - filterFn: (row, id, value) => { - return value.includes(row.getValue(id)); - }, - }, - { - accessorKey: 'priority', - header: ({ column }) => ( - - ), - cell: ({ row }) => { - const priority = priorities.find( - (priority) => priority.value === row.getValue('priority') - ); - - if (!priority) { - return null; - } - - return ( -
- {priority.icon && ( - - )} - {priority.label} -
- ); - }, - filterFn: (row, id, value) => { - return value.includes(row.getValue(id)); - }, - }, - { - id: 'actions', - cell: ({ row }) => , - }, -]; diff --git a/src/app/employees/components/data-table-column-header.tsx b/src/app/employees/components/data-table-column-header.tsx deleted file mode 100644 index cae0467..0000000 --- a/src/app/employees/components/data-table-column-header.tsx +++ /dev/null @@ -1,71 +0,0 @@ -import { - ArrowDownIcon, - ArrowUpIcon, - CaretSortIcon, - EyeNoneIcon, -} from '@radix-ui/react-icons'; -import { Column } from '@tanstack/react-table'; - -import { cn } from '@/lib/utils'; -import { Button } from '@/components/ui/button'; -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuSeparator, - DropdownMenuTrigger, -} from '@/components/ui/dropdown-menu'; - -interface DataTableColumnHeaderProps - extends React.HTMLAttributes { - column: Column; - title: string; -} - -export function DataTableColumnHeader({ - column, - title, - className, -}: DataTableColumnHeaderProps) { - if (!column.getCanSort()) { - return
{title}
; - } - - return ( -
- - - - - - column.toggleSorting(false)}> - - Asc - - column.toggleSorting(true)}> - - Desc - - - column.toggleVisibility(false)}> - - Hide - - - -
- ); -} diff --git a/src/app/employees/components/data-table-faceted-filter.tsx b/src/app/employees/components/data-table-faceted-filter.tsx deleted file mode 100644 index 6a39884..0000000 --- a/src/app/employees/components/data-table-faceted-filter.tsx +++ /dev/null @@ -1,147 +0,0 @@ -import * as React from 'react'; -import { CheckIcon, PlusCircledIcon } from '@radix-ui/react-icons'; -import { Column } from '@tanstack/react-table'; - -import { cn } from '@/lib/utils'; -import { Badge } from '@/components/ui/badge'; -import { Button } from '@/components/ui/button'; -import { - Command, - CommandEmpty, - CommandGroup, - CommandInput, - CommandItem, - CommandList, - CommandSeparator, -} from '@/components/ui/command'; -import { - Popover, - PopoverContent, - PopoverTrigger, -} from '@/components/ui/popover'; -import { Separator } from '@/components/ui/separator'; - -interface DataTableFacetedFilterProps { - column?: Column; - title?: string; - options: { - label: string; - value: string; - icon?: React.ComponentType<{ className?: string }>; - }[]; -} - -export function DataTableFacetedFilter({ - column, - title, - options, -}: DataTableFacetedFilterProps) { - const facets = column?.getFacetedUniqueValues(); - const selectedValues = new Set(column?.getFilterValue() as string[]); - - return ( - - - - - - - - - No results found. - - {options.map((option) => { - const isSelected = selectedValues.has(option.value); - return ( - { - if (isSelected) { - selectedValues.delete(option.value); - } else { - selectedValues.add(option.value); - } - const filterValues = Array.from(selectedValues); - column?.setFilterValue( - filterValues.length ? filterValues : undefined - ); - }} - > -
- -
- {option.icon && ( - - )} - {option.label} - {facets?.get(option.value) && ( - - {facets.get(option.value)} - - )} -
- ); - })} -
- {selectedValues.size > 0 && ( - <> - - - column?.setFilterValue(undefined)} - className='justify-center text-center' - > - Clear filters - - - - )} -
-
-
-
- ); -} diff --git a/src/app/employees/components/data-table-pagination.tsx b/src/app/employees/components/data-table-pagination.tsx deleted file mode 100644 index 17a6a52..0000000 --- a/src/app/employees/components/data-table-pagination.tsx +++ /dev/null @@ -1,97 +0,0 @@ -import { - ChevronLeftIcon, - ChevronRightIcon, - DoubleArrowLeftIcon, - DoubleArrowRightIcon, -} from '@radix-ui/react-icons'; -import { Table } from '@tanstack/react-table'; - -import { Button } from '@/components/ui/button'; -import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, -} from '@/components/ui/select'; - -interface DataTablePaginationProps { - table: Table; -} - -export function DataTablePagination({ - table, -}: DataTablePaginationProps) { - return ( -
-
- {table.getFilteredSelectedRowModel().rows.length} of{' '} - {table.getFilteredRowModel().rows.length} row(s) selected. -
-
-
-

Rows per page

- -
-
- Page {table.getState().pagination.pageIndex + 1} of{' '} - {table.getPageCount()} -
-
- - - - -
-
-
- ); -} diff --git a/src/app/employees/components/data-table-row-actions.tsx b/src/app/employees/components/data-table-row-actions.tsx deleted file mode 100644 index f66e337..0000000 --- a/src/app/employees/components/data-table-row-actions.tsx +++ /dev/null @@ -1,69 +0,0 @@ -'use client'; - -import { DotsHorizontalIcon } from '@radix-ui/react-icons'; -import { Row } from '@tanstack/react-table'; - -import { Button } from '@/components/ui/button'; -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuRadioGroup, - DropdownMenuRadioItem, - DropdownMenuSeparator, - DropdownMenuShortcut, - DropdownMenuSub, - DropdownMenuSubContent, - DropdownMenuSubTrigger, - DropdownMenuTrigger, -} from '@/components/ui/dropdown-menu'; - -import { labels } from '../data/data'; -import { taskSchema } from '../data/schema'; - -interface DataTableRowActionsProps { - row: Row; -} - -export function DataTableRowActions({ - row, -}: DataTableRowActionsProps) { - const task = taskSchema.parse(row.original); - - return ( - - - - - - Edit - Make a copy - Favorite - - - Labels - - - {labels.map((label) => ( - - {label.label} - - ))} - - - - - - Delete - ⌘⌫ - - - - ); -} diff --git a/src/app/employees/components/data-table-toolbar.tsx b/src/app/employees/components/data-table-toolbar.tsx deleted file mode 100644 index 86fd984..0000000 --- a/src/app/employees/components/data-table-toolbar.tsx +++ /dev/null @@ -1,61 +0,0 @@ -'use client'; - -import { Cross2Icon } from '@radix-ui/react-icons'; -import { Table } from '@tanstack/react-table'; - -import { Button } from '@/components/ui/button'; -import { Input } from '@/components/ui/input'; -import { DataTableViewOptions } from './data-table-view-options'; - -import { priorities, statuses } from '../data/data'; -import { DataTableFacetedFilter } from './data-table-faceted-filter'; - -interface DataTableToolbarProps { - table: Table; -} - -export function DataTableToolbar({ - table, -}: DataTableToolbarProps) { - const isFiltered = table.getState().columnFilters.length > 0; - - return ( -
-
- - table.getColumn('title')?.setFilterValue(event.target.value) - } - className='h-8 w-[150px] lg:w-[250px]' - /> - {table.getColumn('status') && ( - - )} - {table.getColumn('priority') && ( - - )} - {isFiltered && ( - - )} -
- -
- ); -} diff --git a/src/app/employees/components/data-table-view-options.tsx b/src/app/employees/components/data-table-view-options.tsx deleted file mode 100644 index 654c42d..0000000 --- a/src/app/employees/components/data-table-view-options.tsx +++ /dev/null @@ -1,59 +0,0 @@ -'use client'; - -import { DropdownMenuTrigger } from '@radix-ui/react-dropdown-menu'; -import { MixerHorizontalIcon } from '@radix-ui/react-icons'; -import { Table } from '@tanstack/react-table'; - -import { Button } from '@/components/ui/button'; -import { - DropdownMenu, - DropdownMenuCheckboxItem, - DropdownMenuContent, - DropdownMenuLabel, - DropdownMenuSeparator, -} from '@/components/ui/dropdown-menu'; - -interface DataTableViewOptionsProps { - table: Table; -} - -export function DataTableViewOptions({ - table, -}: DataTableViewOptionsProps) { - return ( - - - - - - Toggle columns - - {table - .getAllColumns() - .filter( - (column) => - typeof column.accessorFn !== 'undefined' && column.getCanHide() - ) - .map((column) => { - return ( - column.toggleVisibility(!!value)} - > - {column.id} - - ); - })} - - - ); -} diff --git a/src/app/employees/components/data-table.tsx b/src/app/employees/components/data-table.tsx deleted file mode 100644 index f2f87ae..0000000 --- a/src/app/employees/components/data-table.tsx +++ /dev/null @@ -1,126 +0,0 @@ -'use client'; - -import * as React from 'react'; -import { - ColumnDef, - ColumnFiltersState, - SortingState, - VisibilityState, - flexRender, - getCoreRowModel, - getFacetedRowModel, - getFacetedUniqueValues, - getFilteredRowModel, - getPaginationRowModel, - getSortedRowModel, - useReactTable, -} from '@tanstack/react-table'; - -import { - Table, - TableBody, - TableCell, - TableHead, - TableHeader, - TableRow, -} from '@/components/ui/table'; - -import { DataTablePagination } from './data-table-pagination'; -import { DataTableToolbar } from './data-table-toolbar'; - -interface DataTableProps { - columns: ColumnDef[]; - data: TData[]; -} - -export function DataTable({ - columns, - data, -}: DataTableProps) { - const [rowSelection, setRowSelection] = React.useState({}); - const [columnVisibility, setColumnVisibility] = - React.useState({}); - const [columnFilters, setColumnFilters] = React.useState( - [] - ); - const [sorting, setSorting] = React.useState([]); - - const table = useReactTable({ - data, - columns, - state: { - sorting, - columnVisibility, - rowSelection, - columnFilters, - }, - enableRowSelection: true, - onRowSelectionChange: setRowSelection, - onSortingChange: setSorting, - onColumnFiltersChange: setColumnFilters, - onColumnVisibilityChange: setColumnVisibility, - getCoreRowModel: getCoreRowModel(), - getFilteredRowModel: getFilteredRowModel(), - getPaginationRowModel: getPaginationRowModel(), - getSortedRowModel: getSortedRowModel(), - getFacetedRowModel: getFacetedRowModel(), - getFacetedUniqueValues: getFacetedUniqueValues(), - }); - - return ( -
- -
- - - {table.getHeaderGroups().map((headerGroup) => ( - - {headerGroup.headers.map((header) => { - return ( - - {header.isPlaceholder - ? null - : flexRender( - header.column.columnDef.header, - header.getContext() - )} - - ); - })} - - ))} - - - {table.getRowModel().rows?.length ? ( - table.getRowModel().rows.map((row) => ( - - {row.getVisibleCells().map((cell) => ( - - {flexRender( - cell.column.columnDef.cell, - cell.getContext() - )} - - ))} - - )) - ) : ( - - - No results. - - - )} - -
-
- -
- ); -} diff --git a/src/app/employees/components/user-nav.tsx b/src/app/employees/components/user-nav.tsx deleted file mode 100644 index 6cd0675..0000000 --- a/src/app/employees/components/user-nav.tsx +++ /dev/null @@ -1,58 +0,0 @@ -import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'; -import { Button } from '@/components/ui/button'; -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuGroup, - DropdownMenuItem, - DropdownMenuLabel, - DropdownMenuSeparator, - DropdownMenuShortcut, - DropdownMenuTrigger, -} from '@/components/ui/dropdown-menu'; - -export function UserNav() { - return ( - - - - - - -
-

shadcn

-

- m@example.com -

-
-
- - - - Profile - ⇧⌘P - - - Billing - ⌘B - - - Settings - ⌘S - - New Team - - - - Log out - ⇧⌘Q - -
-
- ); -} diff --git a/src/app/employees/data/data.tsx b/src/app/employees/data/data.tsx deleted file mode 100644 index 5a97fe2..0000000 --- a/src/app/employees/data/data.tsx +++ /dev/null @@ -1,71 +0,0 @@ -import { - ArrowDownIcon, - ArrowRightIcon, - ArrowUpIcon, - CheckCircledIcon, - CircleIcon, - CrossCircledIcon, - QuestionMarkCircledIcon, - StopwatchIcon, -} from '@radix-ui/react-icons'; - -export const labels = [ - { - value: 'bug', - label: 'Bug', - }, - { - value: 'feature', - label: 'Feature', - }, - { - value: 'documentation', - label: 'Documentation', - }, -]; - -export const statuses = [ - { - value: 'backlog', - label: 'Backlog', - icon: QuestionMarkCircledIcon, - }, - { - value: 'todo', - label: 'Todo', - icon: CircleIcon, - }, - { - value: 'in progress', - label: 'In Progress', - icon: StopwatchIcon, - }, - { - value: 'done', - label: 'Done', - icon: CheckCircledIcon, - }, - { - value: 'canceled', - label: 'Canceled', - icon: CrossCircledIcon, - }, -]; - -export const priorities = [ - { - label: 'Low', - value: 'low', - icon: ArrowDownIcon, - }, - { - label: 'Medium', - value: 'medium', - icon: ArrowRightIcon, - }, - { - label: 'High', - value: 'high', - icon: ArrowUpIcon, - }, -]; diff --git a/src/app/employees/data/schema.ts b/src/app/employees/data/schema.ts deleted file mode 100644 index 0885833..0000000 --- a/src/app/employees/data/schema.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { z } from 'zod'; - -// We're keeping a simple non-relational schema here. -// IRL, you will have a schema for your data models. -export const taskSchema = z.object({ - id: z.string(), - title: z.string(), - status: z.string(), - label: z.string(), - priority: z.string(), -}); - -export type Task = z.infer; diff --git a/src/app/employees/data/tasks.json b/src/app/employees/data/tasks.json deleted file mode 100644 index 2d10a4a..0000000 --- a/src/app/employees/data/tasks.json +++ /dev/null @@ -1,702 +0,0 @@ -[ - { - "id": "TASK-8782", - "title": "You can't compress the program without quantifying the open-source SSD pixel!", - "status": "in progress", - "label": "documentation", - "priority": "medium" - }, - { - "id": "TASK-7878", - "title": "Try to calculate the EXE feed, maybe it will index the multi-byte pixel!", - "status": "backlog", - "label": "documentation", - "priority": "medium" - }, - { - "id": "TASK-7839", - "title": "We need to bypass the neural TCP card!", - "status": "todo", - "label": "bug", - "priority": "high" - }, - { - "id": "TASK-5562", - "title": "The SAS interface is down, bypass the open-source pixel so we can back up the PNG bandwidth!", - "status": "backlog", - "label": "feature", - "priority": "medium" - }, - { - "id": "TASK-8686", - "title": "I'll parse the wireless SSL protocol, that should driver the API panel!", - "status": "canceled", - "label": "feature", - "priority": "medium" - }, - { - "id": "TASK-1280", - "title": "Use the digital TLS panel, then you can transmit the haptic system!", - "status": "done", - "label": "bug", - "priority": "high" - }, - { - "id": "TASK-7262", - "title": "The UTF8 application is down, parse the neural bandwidth so we can back up the PNG firewall!", - "status": "done", - "label": "feature", - "priority": "high" - }, - { - "id": "TASK-1138", - "title": "Generating the driver won't do anything, we need to quantify the 1080p SMTP bandwidth!", - "status": "in progress", - "label": "feature", - "priority": "medium" - }, - { - "id": "TASK-7184", - "title": "We need to program the back-end THX pixel!", - "status": "todo", - "label": "feature", - "priority": "low" - }, - { - "id": "TASK-5160", - "title": "Calculating the bus won't do anything, we need to navigate the back-end JSON protocol!", - "status": "in progress", - "label": "documentation", - "priority": "high" - }, - { - "id": "TASK-5618", - "title": "Generating the driver won't do anything, we need to index the online SSL application!", - "status": "done", - "label": "documentation", - "priority": "medium" - }, - { - "id": "TASK-6699", - "title": "I'll transmit the wireless JBOD capacitor, that should hard drive the SSD feed!", - "status": "backlog", - "label": "documentation", - "priority": "medium" - }, - { - "id": "TASK-2858", - "title": "We need to override the online UDP bus!", - "status": "backlog", - "label": "bug", - "priority": "medium" - }, - { - "id": "TASK-9864", - "title": "I'll reboot the 1080p FTP panel, that should matrix the HEX hard drive!", - "status": "done", - "label": "bug", - "priority": "high" - }, - { - "id": "TASK-8404", - "title": "We need to generate the virtual HEX alarm!", - "status": "in progress", - "label": "bug", - "priority": "low" - }, - { - "id": "TASK-5365", - "title": "Backing up the pixel won't do anything, we need to transmit the primary IB array!", - "status": "in progress", - "label": "documentation", - "priority": "low" - }, - { - "id": "TASK-1780", - "title": "The CSS feed is down, index the bluetooth transmitter so we can compress the CLI protocol!", - "status": "todo", - "label": "documentation", - "priority": "high" - }, - { - "id": "TASK-6938", - "title": "Use the redundant SCSI application, then you can hack the optical alarm!", - "status": "todo", - "label": "documentation", - "priority": "high" - }, - { - "id": "TASK-9885", - "title": "We need to compress the auxiliary VGA driver!", - "status": "backlog", - "label": "bug", - "priority": "high" - }, - { - "id": "TASK-3216", - "title": "Transmitting the transmitter won't do anything, we need to compress the virtual HDD sensor!", - "status": "backlog", - "label": "documentation", - "priority": "medium" - }, - { - "id": "TASK-9285", - "title": "The IP monitor is down, copy the haptic alarm so we can generate the HTTP transmitter!", - "status": "todo", - "label": "bug", - "priority": "high" - }, - { - "id": "TASK-1024", - "title": "Overriding the microchip won't do anything, we need to transmit the digital OCR transmitter!", - "status": "in progress", - "label": "documentation", - "priority": "low" - }, - { - "id": "TASK-7068", - "title": "You can't generate the capacitor without indexing the wireless HEX pixel!", - "status": "canceled", - "label": "bug", - "priority": "low" - }, - { - "id": "TASK-6502", - "title": "Navigating the microchip won't do anything, we need to bypass the back-end SQL bus!", - "status": "todo", - "label": "bug", - "priority": "high" - }, - { - "id": "TASK-5326", - "title": "We need to hack the redundant UTF8 transmitter!", - "status": "todo", - "label": "bug", - "priority": "low" - }, - { - "id": "TASK-6274", - "title": "Use the virtual PCI circuit, then you can parse the bluetooth alarm!", - "status": "canceled", - "label": "documentation", - "priority": "low" - }, - { - "id": "TASK-1571", - "title": "I'll input the neural DRAM circuit, that should protocol the SMTP interface!", - "status": "in progress", - "label": "feature", - "priority": "medium" - }, - { - "id": "TASK-9518", - "title": "Compressing the interface won't do anything, we need to compress the online SDD matrix!", - "status": "canceled", - "label": "documentation", - "priority": "medium" - }, - { - "id": "TASK-5581", - "title": "I'll synthesize the digital COM pixel, that should transmitter the UTF8 protocol!", - "status": "backlog", - "label": "documentation", - "priority": "high" - }, - { - "id": "TASK-2197", - "title": "Parsing the feed won't do anything, we need to copy the bluetooth DRAM bus!", - "status": "todo", - "label": "documentation", - "priority": "low" - }, - { - "id": "TASK-8484", - "title": "We need to parse the solid state UDP firewall!", - "status": "in progress", - "label": "bug", - "priority": "low" - }, - { - "id": "TASK-9892", - "title": "If we back up the application, we can get to the UDP application through the multi-byte THX capacitor!", - "status": "done", - "label": "documentation", - "priority": "high" - }, - { - "id": "TASK-9616", - "title": "We need to synthesize the cross-platform ASCII pixel!", - "status": "in progress", - "label": "feature", - "priority": "medium" - }, - { - "id": "TASK-9744", - "title": "Use the back-end IP card, then you can input the solid state hard drive!", - "status": "done", - "label": "documentation", - "priority": "low" - }, - { - "id": "TASK-1376", - "title": "Generating the alarm won't do anything, we need to generate the mobile IP capacitor!", - "status": "backlog", - "label": "documentation", - "priority": "low" - }, - { - "id": "TASK-7382", - "title": "If we back up the firewall, we can get to the RAM alarm through the primary UTF8 pixel!", - "status": "todo", - "label": "feature", - "priority": "low" - }, - { - "id": "TASK-2290", - "title": "I'll compress the virtual JSON panel, that should application the UTF8 bus!", - "status": "canceled", - "label": "documentation", - "priority": "high" - }, - { - "id": "TASK-1533", - "title": "You can't input the firewall without overriding the wireless TCP firewall!", - "status": "done", - "label": "bug", - "priority": "high" - }, - { - "id": "TASK-4920", - "title": "Bypassing the hard drive won't do anything, we need to input the bluetooth JSON program!", - "status": "in progress", - "label": "bug", - "priority": "high" - }, - { - "id": "TASK-5168", - "title": "If we synthesize the bus, we can get to the IP panel through the virtual TLS array!", - "status": "in progress", - "label": "feature", - "priority": "low" - }, - { - "id": "TASK-7103", - "title": "We need to parse the multi-byte EXE bandwidth!", - "status": "canceled", - "label": "feature", - "priority": "low" - }, - { - "id": "TASK-4314", - "title": "If we compress the program, we can get to the XML alarm through the multi-byte COM matrix!", - "status": "in progress", - "label": "bug", - "priority": "high" - }, - { - "id": "TASK-3415", - "title": "Use the cross-platform XML application, then you can quantify the solid state feed!", - "status": "todo", - "label": "feature", - "priority": "high" - }, - { - "id": "TASK-8339", - "title": "Try to calculate the DNS interface, maybe it will input the bluetooth capacitor!", - "status": "in progress", - "label": "feature", - "priority": "low" - }, - { - "id": "TASK-6995", - "title": "Try to hack the XSS bandwidth, maybe it will override the bluetooth matrix!", - "status": "todo", - "label": "feature", - "priority": "high" - }, - { - "id": "TASK-8053", - "title": "If we connect the program, we can get to the UTF8 matrix through the digital UDP protocol!", - "status": "todo", - "label": "feature", - "priority": "medium" - }, - { - "id": "TASK-4336", - "title": "If we synthesize the microchip, we can get to the SAS sensor through the optical UDP program!", - "status": "todo", - "label": "documentation", - "priority": "low" - }, - { - "id": "TASK-8790", - "title": "I'll back up the optical COM alarm, that should alarm the RSS capacitor!", - "status": "done", - "label": "bug", - "priority": "medium" - }, - { - "id": "TASK-8980", - "title": "Try to navigate the SQL transmitter, maybe it will back up the virtual firewall!", - "status": "canceled", - "label": "bug", - "priority": "low" - }, - { - "id": "TASK-7342", - "title": "Use the neural CLI card, then you can parse the online port!", - "status": "backlog", - "label": "documentation", - "priority": "low" - }, - { - "id": "TASK-5608", - "title": "I'll hack the haptic SSL program, that should bus the UDP transmitter!", - "status": "canceled", - "label": "documentation", - "priority": "low" - }, - { - "id": "TASK-1606", - "title": "I'll generate the bluetooth PNG firewall, that should pixel the SSL driver!", - "status": "done", - "label": "feature", - "priority": "medium" - }, - { - "id": "TASK-7872", - "title": "Transmitting the circuit won't do anything, we need to reboot the 1080p RSS monitor!", - "status": "canceled", - "label": "feature", - "priority": "medium" - }, - { - "id": "TASK-4167", - "title": "Use the cross-platform SMS circuit, then you can synthesize the optical feed!", - "status": "canceled", - "label": "bug", - "priority": "medium" - }, - { - "id": "TASK-9581", - "title": "You can't index the port without hacking the cross-platform XSS monitor!", - "status": "backlog", - "label": "documentation", - "priority": "low" - }, - { - "id": "TASK-8806", - "title": "We need to bypass the back-end SSL panel!", - "status": "done", - "label": "bug", - "priority": "medium" - }, - { - "id": "TASK-6542", - "title": "Try to quantify the RSS firewall, maybe it will quantify the open-source system!", - "status": "done", - "label": "feature", - "priority": "low" - }, - { - "id": "TASK-6806", - "title": "The VGA protocol is down, reboot the back-end matrix so we can parse the CSS panel!", - "status": "canceled", - "label": "documentation", - "priority": "low" - }, - { - "id": "TASK-9549", - "title": "You can't bypass the bus without connecting the neural JBOD bus!", - "status": "todo", - "label": "feature", - "priority": "high" - }, - { - "id": "TASK-1075", - "title": "Backing up the driver won't do anything, we need to parse the redundant RAM pixel!", - "status": "done", - "label": "feature", - "priority": "medium" - }, - { - "id": "TASK-1427", - "title": "Use the auxiliary PCI circuit, then you can calculate the cross-platform interface!", - "status": "done", - "label": "documentation", - "priority": "high" - }, - { - "id": "TASK-1907", - "title": "Hacking the circuit won't do anything, we need to back up the online DRAM system!", - "status": "todo", - "label": "documentation", - "priority": "high" - }, - { - "id": "TASK-4309", - "title": "If we generate the system, we can get to the TCP sensor through the optical GB pixel!", - "status": "backlog", - "label": "bug", - "priority": "medium" - }, - { - "id": "TASK-3973", - "title": "I'll parse the back-end ADP array, that should bandwidth the RSS bandwidth!", - "status": "todo", - "label": "feature", - "priority": "medium" - }, - { - "id": "TASK-7962", - "title": "Use the wireless RAM program, then you can hack the cross-platform feed!", - "status": "canceled", - "label": "bug", - "priority": "low" - }, - { - "id": "TASK-3360", - "title": "You can't quantify the program without synthesizing the neural OCR interface!", - "status": "done", - "label": "feature", - "priority": "medium" - }, - { - "id": "TASK-9887", - "title": "Use the auxiliary ASCII sensor, then you can connect the solid state port!", - "status": "backlog", - "label": "bug", - "priority": "medium" - }, - { - "id": "TASK-3649", - "title": "I'll input the virtual USB system, that should circuit the DNS monitor!", - "status": "in progress", - "label": "feature", - "priority": "medium" - }, - { - "id": "TASK-3586", - "title": "If we quantify the circuit, we can get to the CLI feed through the mobile SMS hard drive!", - "status": "in progress", - "label": "bug", - "priority": "low" - }, - { - "id": "TASK-5150", - "title": "I'll hack the wireless XSS port, that should transmitter the IP interface!", - "status": "canceled", - "label": "feature", - "priority": "medium" - }, - { - "id": "TASK-3652", - "title": "The SQL interface is down, override the optical bus so we can program the ASCII interface!", - "status": "backlog", - "label": "feature", - "priority": "low" - }, - { - "id": "TASK-6884", - "title": "Use the digital PCI circuit, then you can synthesize the multi-byte microchip!", - "status": "canceled", - "label": "feature", - "priority": "high" - }, - { - "id": "TASK-1591", - "title": "We need to connect the mobile XSS driver!", - "status": "in progress", - "label": "feature", - "priority": "high" - }, - { - "id": "TASK-3802", - "title": "Try to override the ASCII protocol, maybe it will parse the virtual matrix!", - "status": "in progress", - "label": "feature", - "priority": "low" - }, - { - "id": "TASK-7253", - "title": "Programming the capacitor won't do anything, we need to bypass the neural IB hard drive!", - "status": "backlog", - "label": "bug", - "priority": "high" - }, - { - "id": "TASK-9739", - "title": "We need to hack the multi-byte HDD bus!", - "status": "done", - "label": "documentation", - "priority": "medium" - }, - { - "id": "TASK-4424", - "title": "Try to hack the HEX alarm, maybe it will connect the optical pixel!", - "status": "in progress", - "label": "documentation", - "priority": "medium" - }, - { - "id": "TASK-3922", - "title": "You can't back up the capacitor without generating the wireless PCI program!", - "status": "backlog", - "label": "bug", - "priority": "low" - }, - { - "id": "TASK-4921", - "title": "I'll index the open-source IP feed, that should system the GB application!", - "status": "canceled", - "label": "bug", - "priority": "low" - }, - { - "id": "TASK-5814", - "title": "We need to calculate the 1080p AGP feed!", - "status": "backlog", - "label": "bug", - "priority": "high" - }, - { - "id": "TASK-2645", - "title": "Synthesizing the system won't do anything, we need to navigate the multi-byte HDD firewall!", - "status": "todo", - "label": "documentation", - "priority": "medium" - }, - { - "id": "TASK-4535", - "title": "Try to copy the JSON circuit, maybe it will connect the wireless feed!", - "status": "in progress", - "label": "feature", - "priority": "low" - }, - { - "id": "TASK-4463", - "title": "We need to copy the solid state AGP monitor!", - "status": "done", - "label": "documentation", - "priority": "low" - }, - { - "id": "TASK-9745", - "title": "If we connect the protocol, we can get to the GB system through the bluetooth PCI microchip!", - "status": "canceled", - "label": "feature", - "priority": "high" - }, - { - "id": "TASK-2080", - "title": "If we input the bus, we can get to the RAM matrix through the auxiliary RAM card!", - "status": "todo", - "label": "bug", - "priority": "medium" - }, - { - "id": "TASK-3838", - "title": "I'll bypass the online TCP application, that should panel the AGP system!", - "status": "backlog", - "label": "bug", - "priority": "high" - }, - { - "id": "TASK-1340", - "title": "We need to navigate the virtual PNG circuit!", - "status": "todo", - "label": "bug", - "priority": "medium" - }, - { - "id": "TASK-6665", - "title": "If we parse the monitor, we can get to the SSD hard drive through the cross-platform AGP alarm!", - "status": "canceled", - "label": "feature", - "priority": "low" - }, - { - "id": "TASK-7585", - "title": "If we calculate the hard drive, we can get to the SSL program through the multi-byte CSS microchip!", - "status": "backlog", - "label": "feature", - "priority": "low" - }, - { - "id": "TASK-6319", - "title": "We need to copy the multi-byte SCSI program!", - "status": "backlog", - "label": "bug", - "priority": "high" - }, - { - "id": "TASK-4369", - "title": "Try to input the SCSI bus, maybe it will generate the 1080p pixel!", - "status": "backlog", - "label": "bug", - "priority": "high" - }, - { - "id": "TASK-9035", - "title": "We need to override the solid state PNG array!", - "status": "canceled", - "label": "documentation", - "priority": "low" - }, - { - "id": "TASK-3970", - "title": "You can't index the transmitter without quantifying the haptic ASCII card!", - "status": "todo", - "label": "documentation", - "priority": "medium" - }, - { - "id": "TASK-4473", - "title": "You can't bypass the protocol without overriding the neural RSS program!", - "status": "todo", - "label": "documentation", - "priority": "low" - }, - { - "id": "TASK-4136", - "title": "You can't hack the hard drive without hacking the primary JSON program!", - "status": "canceled", - "label": "bug", - "priority": "medium" - }, - { - "id": "TASK-3939", - "title": "Use the back-end SQL firewall, then you can connect the neural hard drive!", - "status": "done", - "label": "feature", - "priority": "low" - }, - { - "id": "TASK-2007", - "title": "I'll input the back-end USB protocol, that should bandwidth the PCI system!", - "status": "backlog", - "label": "bug", - "priority": "high" - }, - { - "id": "TASK-7516", - "title": "Use the primary SQL program, then you can generate the auxiliary transmitter!", - "status": "done", - "label": "documentation", - "priority": "medium" - }, - { - "id": "TASK-6906", - "title": "Try to back up the DRAM system, maybe it will reboot the online transmitter!", - "status": "done", - "label": "feature", - "priority": "high" - }, - { - "id": "TASK-5207", - "title": "The SMS interface is down, copy the bluetooth bus so we can quantify the VGA card!", - "status": "in progress", - "label": "bug", - "priority": "low" - } -] diff --git a/src/app/employees/layout-jo-bahar-jayega.tsx b/src/app/employees/layout-jo-bahar-jayega.tsx deleted file mode 100644 index 2713ac1..0000000 --- a/src/app/employees/layout-jo-bahar-jayega.tsx +++ /dev/null @@ -1,63 +0,0 @@ -// Ideally this file will go one level outside. -export {}; - -// import { Metadata } from "next" -// import Link from "next/link" - -// import { cn } from "@/lib/utils" -// import { Announcement } from "@/components/announcement" -// import { ExamplesNav } from "@/components/examples-nav" -// import { -// PageActions, -// PageHeader, -// PageHeaderDescription, -// PageHeaderHeading, -// } from "@/components/page-header" -// import { buttonVariants } from "@/components/ui/button" - -// export const metadata: Metadata = { -// title: "Examples", -// description: "Check out some examples app built using the components.", -// } - -// interface ExamplesLayoutProps { -// children: React.ReactNode -// } - -// export default function ExamplesLayout({ children }: ExamplesLayoutProps) { -// return ( -//
-// -// -// -// Check out some examples -// -// Examples -// -// Dashboard, cards, authentication. Some examples built using the -// components. Use this as a guide to build your own. -// -// -// -// Get Started -// -// -// Components -// -// -// -//
-// -//
-// {children} -//
-//
-//
-// ) -// } diff --git a/src/app/employees/page.tsx b/src/app/employees/page.tsx deleted file mode 100644 index b222c1b..0000000 --- a/src/app/employees/page.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import { promises as fs } from 'fs'; -import path from 'path'; -import { Metadata } from 'next'; -import Image from 'next/image'; -import { z } from 'zod'; - -import { columns } from './components/columns'; -import { DataTable } from './components/data-table'; -import { UserNav } from './components/user-nav'; -import { taskSchema } from './data/schema'; - -export const metadata: Metadata = { - title: 'Tasks', - description: 'A task and issue tracker build using Tanstack Table.', -}; - -// Simulate a database read for tasks. -async function getTasks() { - const data = await fs.readFile( - path.join(process.cwd(), 'src/app/employees/data/tasks.json') - ); - - const tasks = JSON.parse(data.toString()); - - return z.array(taskSchema).parse(tasks); -} - -export default async function Employees() { - const tasks = await getTasks(); - - return ( - <> -
- Playground - Playground -
-
-
-
-

Welcome back!

-

- Here's a list of your tasks for this month! -

-
-
- -
-
- -
- - ); -} diff --git a/src/app/home/components/date-range-picker.tsx b/src/app/home/components/date-range-picker.tsx deleted file mode 100644 index 56f67b7..0000000 --- a/src/app/home/components/date-range-picker.tsx +++ /dev/null @@ -1,65 +0,0 @@ -'use client'; - -import * as React from 'react'; -import { CalendarIcon } from '@radix-ui/react-icons'; -import { addDays, format } from 'date-fns'; -import { DateRange } from 'react-day-picker'; - -import { cn } from '@/lib/utils'; -import { Button } from '@/components/ui/button'; -import { Calendar } from '@/components/ui/calendar'; -import { - Popover, - PopoverContent, - PopoverTrigger, -} from '@/components/ui/popover'; - -export function CalendarDateRangePicker({ - className, -}: React.HTMLAttributes) { - const [date, setDate] = React.useState({ - from: new Date(2023, 0, 20), - to: addDays(new Date(2023, 0, 20), 20), - }); - - return ( -
- - - - - - - - -
- ); -} diff --git a/src/app/home/components/main-nav.tsx b/src/app/home/components/main-nav.tsx deleted file mode 100644 index 19a8205..0000000 --- a/src/app/home/components/main-nav.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import Link from 'next/link'; - -import { cn } from '@/lib/utils'; - -export function MainNav({ - className, - ...props -}: React.HTMLAttributes) { - return ( - - ); -} diff --git a/src/app/home/components/overview.tsx b/src/app/home/components/overview.tsx deleted file mode 100644 index c99f96b..0000000 --- a/src/app/home/components/overview.tsx +++ /dev/null @@ -1,83 +0,0 @@ -'use client'; - -import { Bar, BarChart, ResponsiveContainer, XAxis, YAxis } from 'recharts'; - -const data = [ - { - name: 'Jan', - total: Math.floor(Math.random() * 5000) + 1000, - }, - { - name: 'Feb', - total: Math.floor(Math.random() * 5000) + 1000, - }, - { - name: 'Mar', - total: Math.floor(Math.random() * 5000) + 1000, - }, - { - name: 'Apr', - total: Math.floor(Math.random() * 5000) + 1000, - }, - { - name: 'May', - total: Math.floor(Math.random() * 5000) + 1000, - }, - { - name: 'Jun', - total: Math.floor(Math.random() * 5000) + 1000, - }, - { - name: 'Jul', - total: Math.floor(Math.random() * 5000) + 1000, - }, - { - name: 'Aug', - total: Math.floor(Math.random() * 5000) + 1000, - }, - { - name: 'Sep', - total: Math.floor(Math.random() * 5000) + 1000, - }, - { - name: 'Oct', - total: Math.floor(Math.random() * 5000) + 1000, - }, - { - name: 'Nov', - total: Math.floor(Math.random() * 5000) + 1000, - }, - { - name: 'Dec', - total: Math.floor(Math.random() * 5000) + 1000, - }, -]; - -export function Overview() { - return ( - - - - `$${value}`} - /> - - - - ); -} diff --git a/src/app/home/components/recent-sales.tsx b/src/app/home/components/recent-sales.tsx deleted file mode 100644 index 492f915..0000000 --- a/src/app/home/components/recent-sales.tsx +++ /dev/null @@ -1,67 +0,0 @@ -import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'; - -export function RecentSales() { - return ( -
-
- - - OM - -
-

Olivia Martin

-

- olivia.martin@email.com -

-
-
+$1,999.00
-
-
- - - JL - -
-

Jackson Lee

-

jackson.lee@email.com

-
-
+$39.00
-
-
- - - IN - -
-

Isabella Nguyen

-

- isabella.nguyen@email.com -

-
-
+$299.00
-
-
- - - WK - -
-

William Kim

-

will@email.com

-
-
+$99.00
-
-
- - - SD - -
-

Sofia Davis

-

sofia.davis@email.com

-
-
+$39.00
-
-
- ); -} diff --git a/src/app/home/components/search.tsx b/src/app/home/components/search.tsx deleted file mode 100644 index 625ffd2..0000000 --- a/src/app/home/components/search.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import { Input } from '@/components/ui/input'; - -export function Search() { - return ( -
- -
- ); -} diff --git a/src/app/home/components/team-switcher.tsx b/src/app/home/components/team-switcher.tsx deleted file mode 100644 index 3149d4d..0000000 --- a/src/app/home/components/team-switcher.tsx +++ /dev/null @@ -1,212 +0,0 @@ -'use client'; - -import * as React from 'react'; -import { - CaretSortIcon, - CheckIcon, - PlusCircledIcon, -} from '@radix-ui/react-icons'; - -import { cn } from '@/lib/utils'; -import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'; -import { Button } from '@/components/ui/button'; -import { - Command, - CommandEmpty, - CommandGroup, - CommandInput, - CommandItem, - CommandList, - CommandSeparator, -} from '@/components/ui/command'; -import { - Dialog, - DialogContent, - DialogDescription, - DialogFooter, - DialogHeader, - DialogTitle, - DialogTrigger, -} from '@/components/ui/dialog'; -import { Input } from '@/components/ui/input'; -import { Label } from '@/components/ui/label'; -import { - Popover, - PopoverContent, - PopoverTrigger, -} from '@/components/ui/popover'; -import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, -} from '@/components/ui/select'; - -const groups = [ - { - label: 'Personal Account', - teams: [ - { - label: 'Alicia Koch', - value: 'personal', - }, - ], - }, - { - label: 'Teams', - teams: [ - { - label: 'Acme Inc.', - value: 'acme-inc', - }, - { - label: 'Monsters Inc.', - value: 'monsters', - }, - ], - }, -]; - -type Team = (typeof groups)[number]['teams'][number]; - -type PopoverTriggerProps = React.ComponentPropsWithoutRef< - typeof PopoverTrigger ->; - -interface TeamSwitcherProps extends PopoverTriggerProps {} - -export default function TeamSwitcher({ className }: TeamSwitcherProps) { - const [open, setOpen] = React.useState(false); - const [showNewTeamDialog, setShowNewTeamDialog] = React.useState(false); - const [selectedTeam, setSelectedTeam] = React.useState( - groups[0].teams[0] - ); - - return ( - - - - - - - - - - No team found. - {groups.map((group) => ( - - {group.teams.map((team) => ( - { - setSelectedTeam(team); - setOpen(false); - }} - className='text-sm' - > - - - SC - - {team.label} - - - ))} - - ))} - - - - - - { - setOpen(false); - setShowNewTeamDialog(true); - }} - > - - Create Team - - - - - - - - - - Create team - - Add a new team to manage products and customers. - - -
-
-
- - -
-
- - -
-
-
- - - - -
-
- ); -} diff --git a/src/app/home/components/user-nav.tsx b/src/app/home/components/user-nav.tsx deleted file mode 100644 index 858855a..0000000 --- a/src/app/home/components/user-nav.tsx +++ /dev/null @@ -1,58 +0,0 @@ -import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'; -import { Button } from '@/components/ui/button'; -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuGroup, - DropdownMenuItem, - DropdownMenuLabel, - DropdownMenuSeparator, - DropdownMenuShortcut, - DropdownMenuTrigger, -} from '@/components/ui/dropdown-menu'; - -export function UserNav() { - return ( - - - - - - -
-

shadcn

-

- m@example.com -

-
-
- - - - Profile - ⇧⌘P - - - Billing - ⌘B - - - Settings - ⌘S - - New Team - - - - Log out - ⇧⌘Q - -
-
- ); -} diff --git a/src/app/home/layout.tsx b/src/app/home/layout.tsx deleted file mode 100644 index d447471..0000000 --- a/src/app/home/layout.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { Metadata } from 'next'; -import * as React from 'react'; - -import '@/styles/colors.css'; - -export const metadata: Metadata = { - title: 'Home', - description: 'Welcome to your home', -}; - -export default function ComponentsLayout({ - children, -}: { - children: React.ReactNode; -}) { - return <>{children}; -} diff --git a/src/app/home/page.tsx b/src/app/home/page.tsx deleted file mode 100644 index a85dfe2..0000000 --- a/src/app/home/page.tsx +++ /dev/null @@ -1,208 +0,0 @@ -import { Metadata } from 'next'; -import Image from 'next/image'; - -import { Button } from '@/components/ui/button'; -import { - Card, - CardContent, - CardDescription, - CardHeader, - CardTitle, -} from '@/components/ui/card'; -import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'; -import { CalendarDateRangePicker } from './components/date-range-picker'; -import { MainNav } from './components/main-nav'; -import { Overview } from './components/overview'; -import { RecentSales } from './components/recent-sales'; -import { Search } from './components/search'; -import TeamSwitcher from './components/team-switcher'; -import { UserNav } from './components/user-nav'; - -export const metadata: Metadata = { - title: 'Dashboard', - description: 'Example dashboard app built using the components.', -}; - -export default function DashboardPage() { - return ( - <> -
- Dashboard - Dashboard -
-
-
-
- - -
- - -
-
-
-
-
-

Dashboard

-
- - -
-
- - - Overview - - Analytics - - - Reports - - - Notifications - - - -
- - - - Total Revenue - - - - - - -
$45,231.89
-

- +20.1% from last month -

-
-
- - - - Subscriptions - - - - - - - - -
+2350
-

- +180.1% from last month -

-
-
- - - Sales - - - - - - -
+12,234
-

- +19% from last month -

-
-
- - - - Active Now - - - - - - -
+573
-

- +201 since last hour -

-
-
-
-
- - - Overview - - - - - - - - Recent Sales - - You made 265 sales this month. - - - - - - -
-
-
-
-
- - ); -}