update layout
This commit is contained in:
@@ -7,12 +7,11 @@ import {
|
||||
DownloadIcon,
|
||||
FileSpreadsheetIcon,
|
||||
FileTextIcon,
|
||||
PlusCircleIcon,
|
||||
PlusIcon
|
||||
PlusCircleIcon
|
||||
} from 'lucide-react'
|
||||
import { MeiliSearchFilterBuilder } from 'meilisearch-helper'
|
||||
import { Suspense, useState } from 'react'
|
||||
import { Await, Link, Outlet, useParams, useSearchParams } from 'react-router'
|
||||
import { Await, Outlet, useSearchParams } from 'react-router'
|
||||
import type { BookType } from 'xlsx'
|
||||
import * as XLSX from 'xlsx'
|
||||
|
||||
@@ -39,9 +38,8 @@ export function meta({}: Route.MetaArgs) {
|
||||
return [{ title: 'Matrículas' }]
|
||||
}
|
||||
|
||||
export async function loader({ params, context, request }: Route.LoaderArgs) {
|
||||
export async function loader({ context, request }: Route.LoaderArgs) {
|
||||
const { searchParams } = new URL(request.url)
|
||||
const { orgid } = params
|
||||
const query = searchParams.get('q') || ''
|
||||
const from = searchParams.get('from')
|
||||
const to = searchParams.get('to')
|
||||
@@ -89,12 +87,7 @@ export default function Route({ loaderData: { data } }) {
|
||||
return (
|
||||
<Suspense fallback={<Skeleton />}>
|
||||
<div className="space-y-0.5 mb-8">
|
||||
<h1 className="text-2xl font-bold tracking-tight">
|
||||
Gerenciar matrículas
|
||||
</h1>
|
||||
<p className="text-muted-foreground">
|
||||
Matricule colaboradores de forma rápida e acompanhe seu progresso.
|
||||
</p>
|
||||
<h1 className="text-2xl font-bold tracking-tight">Matrículas</h1>
|
||||
</div>
|
||||
|
||||
<Await resolve={data}>
|
||||
@@ -248,8 +241,6 @@ export function ExportMenu({
|
||||
headers: Record<string, string>
|
||||
selectedRows: object[]
|
||||
}) {
|
||||
const { orgid } = useParams()
|
||||
|
||||
const exportFile = (bookType: BookType) => () => {
|
||||
if (!selectedRows.length) {
|
||||
return
|
||||
@@ -267,7 +258,7 @@ export function ExportMenu({
|
||||
origin: 'A1'
|
||||
})
|
||||
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1')
|
||||
XLSX.writeFile(workbook, `${orgid}_users_${+now}.${bookType}`, {
|
||||
XLSX.writeFile(workbook, `users_${+now}.${bookType}`, {
|
||||
bookType,
|
||||
compression: true
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user