update
This commit is contained in:
@@ -6,10 +6,11 @@ import { Suspense, useMemo } from 'react'
|
||||
import { Await, useSearchParams } from 'react-router'
|
||||
|
||||
import placeholder from '@/assets/placeholder.webp'
|
||||
import { SearchForm } from '@/components/search-form'
|
||||
import { Skeleton } from '@/components/skeleton'
|
||||
import { createSearch } from '@/lib/meili'
|
||||
import { request as req } from '@/lib/request'
|
||||
|
||||
import { SearchForm } from '@repo/ui/components/search-form'
|
||||
import { Skeleton } from '@repo/ui/components/skeleton'
|
||||
import {
|
||||
Card,
|
||||
CardFooter,
|
||||
|
||||
@@ -7,11 +7,12 @@ import { Suspense, useState } from 'react'
|
||||
import { Await, Link, useSearchParams } from 'react-router'
|
||||
|
||||
import { CustomizeColumns, DataTable } from '@/components/data-table'
|
||||
import { FacetedFilter } from '@/components/faceted-filter'
|
||||
import { RangeCalendarFilter } from '@/components/range-calendar-filter'
|
||||
import { SearchForm } from '@/components/search-form'
|
||||
import { Skeleton } from '@/components/skeleton'
|
||||
import { createSearch } from '@/lib/meili'
|
||||
|
||||
import { FacetedFilter } from '@repo/ui/components/faceted-filter'
|
||||
import { SearchForm } from '@repo/ui/components/search-form'
|
||||
import { Skeleton } from '@repo/ui/components/skeleton'
|
||||
import { Button } from '@repo/ui/components/ui/button'
|
||||
import { Kbd } from '@repo/ui/components/ui/kbd'
|
||||
import {
|
||||
@@ -128,33 +129,6 @@ export default function Route({ loaderData: { data } }) {
|
||||
|
||||
<div className="flex gap-2.5 max-lg:flex-col w-full">
|
||||
<div className="flex gap-2.5 max-lg:flex-col">
|
||||
<FacetedFilter
|
||||
icon={BookCopyIcon}
|
||||
className="lg:flex-1"
|
||||
value={searchParams.getAll('courses')}
|
||||
onChange={(courses) => {
|
||||
setSearchParams((searchParams) => {
|
||||
searchParams.delete('courses')
|
||||
searchParams.delete('p')
|
||||
|
||||
if (statuses.length) {
|
||||
courses.forEach((s) =>
|
||||
searchParams.has('courses', s)
|
||||
? null
|
||||
: searchParams.append('courses', s)
|
||||
)
|
||||
}
|
||||
|
||||
return searchParams
|
||||
})
|
||||
}}
|
||||
title="Cursos"
|
||||
options={Object.entries(statuses).map(([key, value]) => ({
|
||||
value: key,
|
||||
...value
|
||||
}))}
|
||||
/>
|
||||
|
||||
<FacetedFilter
|
||||
icon={PlusCircleIcon}
|
||||
className="lg:flex-1"
|
||||
|
||||
@@ -4,8 +4,8 @@ import { Suspense } from 'react'
|
||||
import { Await } from 'react-router'
|
||||
|
||||
import { DataTable } from '@/components/data-table'
|
||||
import { Skeleton } from '@/components/skeleton'
|
||||
import { createSearch } from '@/lib/meili'
|
||||
import { Skeleton } from '@repo/ui/components/skeleton'
|
||||
import { columns, type Order } from './columns'
|
||||
|
||||
export function meta({}: Route.MetaArgs) {
|
||||
|
||||
@@ -3,8 +3,8 @@ import type { Route } from './+types'
|
||||
import { Suspense } from 'react'
|
||||
import { Await } from 'react-router'
|
||||
|
||||
import { Skeleton } from '@/components/skeleton'
|
||||
import { request as req } from '@/lib/request'
|
||||
import { Skeleton } from '@repo/ui/components/skeleton'
|
||||
|
||||
export async function loader({ params, request, context }: Route.LoaderArgs) {
|
||||
const { id } = params
|
||||
|
||||
@@ -2,8 +2,8 @@ import { Await } from 'react-router'
|
||||
|
||||
import type { Route } from './+types'
|
||||
|
||||
import { Skeleton } from '@/components/skeleton'
|
||||
import { request as req } from '@/lib/request'
|
||||
import { Skeleton } from '@repo/ui/components/skeleton'
|
||||
import { Suspense } from 'react'
|
||||
|
||||
export async function loader({ params, request, context }: Route.LoaderArgs) {
|
||||
|
||||
@@ -5,12 +5,13 @@ import { Suspense } from 'react'
|
||||
import { Await, Link, useSearchParams } from 'react-router'
|
||||
|
||||
import { DataTable } from '@/components/data-table'
|
||||
import { SearchForm } from '@/components/search-form'
|
||||
import { Skeleton } from '@/components/skeleton'
|
||||
import { createSearch } from '@/lib/meili'
|
||||
import { columns, type User } from './columns'
|
||||
|
||||
import { SearchForm } from '@repo/ui/components/search-form'
|
||||
import { Skeleton } from '@repo/ui/components/skeleton'
|
||||
import { Button } from '@repo/ui/components/ui/button'
|
||||
import { Kbd } from '@repo/ui/components/ui/kbd'
|
||||
import { columns, type User } from './columns'
|
||||
|
||||
export function meta({}: Route.MetaArgs) {
|
||||
return [
|
||||
|
||||
@@ -3,11 +3,8 @@ import type { Route } from './+types'
|
||||
import { useLoaderData } from 'react-router'
|
||||
|
||||
import { DataTable } from '@/components/data-table'
|
||||
import { authMiddleware } from '@/middleware/auth'
|
||||
import { columns, type Webhook } from './columns'
|
||||
|
||||
export const middleware: Route.MiddlewareFunction[] = [authMiddleware]
|
||||
|
||||
export function meta({}: Route.MetaArgs) {
|
||||
return [{ title: 'Webhooks' }]
|
||||
}
|
||||
|
||||
@@ -3,17 +3,18 @@ import type { Route } from './+types'
|
||||
import { Outlet, type ShouldRevalidateFunctionArgs } from 'react-router'
|
||||
|
||||
import { AppSidebar } from '@/components/app-sidebar'
|
||||
import { ModeToggle, ThemedImage } from '@/components/dark-mode'
|
||||
import { NavUser } from '@/components/nav-user'
|
||||
import { userContext } from '@/context'
|
||||
import { useIsMobile } from '@/hooks/use-mobile'
|
||||
import { request as req } from '@/lib/request'
|
||||
import { authMiddleware } from '@/middleware/auth'
|
||||
|
||||
import { userContext } from '@repo/auth/context'
|
||||
import { authMiddleware } from '@repo/auth/middleware/auth'
|
||||
import { ModeToggle, ThemedImage } from '@repo/ui/components/dark-mode'
|
||||
import { NavUser } from '@repo/ui/components/nav-user'
|
||||
import {
|
||||
SidebarInset,
|
||||
SidebarProvider,
|
||||
SidebarTrigger
|
||||
} from '@repo/ui/components/ui/sidebar'
|
||||
import { useIsMobile } from '@repo/ui/hooks/use-mobile'
|
||||
|
||||
export const middleware: Route.MiddlewareFunction[] = [authMiddleware]
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ import type { Route } from './+types'
|
||||
|
||||
import { redirect } from 'react-router'
|
||||
|
||||
import { userContext } from '@/context'
|
||||
import { request as req } from '@/lib/request'
|
||||
import { authMiddleware } from '@/middleware/auth'
|
||||
import { userContext } from '@repo/auth/context'
|
||||
import { authMiddleware } from '@repo/auth/middleware/auth'
|
||||
|
||||
export const middleware: Route.MiddlewareFunction[] = [authMiddleware]
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ import type { Route } from './+types'
|
||||
|
||||
import { redirect } from 'react-router'
|
||||
|
||||
import { requestIdContext } from '@/context'
|
||||
import { createAuth, type User } from '@/lib/auth'
|
||||
import { createSessionStorage } from '@/lib/session'
|
||||
import { createAuth, type User } from '@repo/auth/auth'
|
||||
import { requestIdContext } from '@repo/auth/context'
|
||||
import { createSessionStorage } from '@repo/auth/session'
|
||||
|
||||
export async function loader({ request, context }: Route.ActionArgs) {
|
||||
const sessionStorage = createSessionStorage(context.cloudflare.env)
|
||||
|
||||
@@ -3,8 +3,8 @@ import type { Route } from './+types'
|
||||
import { redirect } from 'react-router'
|
||||
import type { OAuth2Strategy } from 'remix-auth-oauth2'
|
||||
|
||||
import { createAuth, type User } from '@/lib/auth'
|
||||
import { createSessionStorage } from '@/lib/session'
|
||||
import { createAuth, type User } from '@repo/auth/auth'
|
||||
import { createSessionStorage } from '@repo/auth/session'
|
||||
|
||||
export async function loader({ request, context }: Route.LoaderArgs) {
|
||||
const authenticator = createAuth(context.cloudflare.env)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { Route } from './+types'
|
||||
|
||||
import { userContext } from '@/context'
|
||||
import type { User } from '@/lib/auth'
|
||||
import { authMiddleware } from '@/middleware/auth'
|
||||
import type { User } from '@repo/auth/auth'
|
||||
import { userContext } from '@repo/auth/context'
|
||||
import { authMiddleware } from '@repo/auth/middleware/auth'
|
||||
|
||||
export const middleware: Route.MiddlewareFunction[] = [authMiddleware]
|
||||
export const loader = proxy
|
||||
|
||||
Reference in New Issue
Block a user