Skip to content

Commit 9d67f54

Browse files
♻️ Extract type
1 parent 18fc342 commit 9d67f54

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

pages/reports.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ import { SelectedPick } from '@xata.io/client';
66
import { ChangeEvent, useState } from 'react';
77
import axios from 'axios';
88

9+
type Report = Readonly<SelectedPick<ReportsRecord, ['*']>>;
910
interface ReportsPageProps {
10-
reports: Readonly<SelectedPick<ReportsRecord, ['*']>>[];
11+
reports: Report[];
1112
}
1213

1314
export default function ReportsPage({ reports }: ReportsPageProps) {
@@ -24,11 +25,7 @@ export default function ReportsPage({ reports }: ReportsPageProps) {
2425
);
2526
}
2627

27-
function ReportCard({
28-
report
29-
}: {
30-
report: ReportsPageProps['reports'][number];
31-
}) {
28+
function ReportCard({ report }: { report: Report }) {
3229
const [isValid, setIsValid] = useState(report.valid);
3330

3431
async function handleToggleVisibility(e: ChangeEvent<HTMLInputElement>) {

0 commit comments

Comments
 (0)