Skip to content

Commit 0e326a6

Browse files
committed
style: remove unused types, apply oxfmt formatting
1 parent 83df80c commit 0e326a6

2 files changed

Lines changed: 12 additions & 32 deletions

File tree

src/app/admin/bulk-credits/page.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,7 @@ function BulkCreditsTab() {
419419
{item.email}
420420
</li>
421421
))}
422-
{unmatchedEmails.length > 5 && (
423-
<li>...and {unmatchedEmails.length - 5} more</li>
424-
)}
422+
{unmatchedEmails.length > 5 && <li>...and {unmatchedEmails.length - 5} more</li>}
425423
</ul>
426424
</div>
427425
)}

src/app/admin/components/KiloclawExtendTrial.tsx

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,6 @@ type CsvData = {
4444
rows: Record<string, string>[];
4545
};
4646

47-
type MatchedUser = {
48-
email: string;
49-
userId: string;
50-
userName: string | null;
51-
subscriptionStatus: string | null;
52-
instanceId: string | null;
53-
};
54-
55-
type UnmatchedEmail = {
56-
email: string;
57-
};
58-
5947
type TrialResult = {
6048
email: string;
6149
userId: string;
@@ -164,7 +152,10 @@ function parseEmailList(text: string): string[] {
164152
const parts = text.split(/[\n,;\s]+/);
165153
for (const part of parts) {
166154
// Strip surrounding quotes, angle brackets, and whitespace
167-
const val = part.replace(/^[<"'\s]+|[>"'\s]+$/g, '').toLowerCase().trim();
155+
const val = part
156+
.replace(/^[<"'\s]+|[>"'\s]+$/g, '')
157+
.toLowerCase()
158+
.trim();
168159
if (val && val.includes('@') && val.includes('.') && !seen.has(val)) {
169160
seen.add(val);
170161
emails.push(val);
@@ -340,9 +331,7 @@ export function KiloclawExtendTrial() {
340331

341332
const handleExtendTrials = () => {
342333
const eligibleEmails = matchedUsers
343-
.filter(
344-
u => u.subscriptionStatus === 'trialing' || u.subscriptionStatus === 'canceled'
345-
)
334+
.filter(u => u.subscriptionStatus === 'trialing' || u.subscriptionStatus === 'canceled')
346335
.map(u => u.email);
347336
if (eligibleEmails.length === 0) return;
348337
const days = parseInt(trialDays, 10);
@@ -422,10 +411,7 @@ export function KiloclawExtendTrial() {
422411

423412
const ineligibleCount = matchedUsers.length - eligibleCount;
424413

425-
const canMatch =
426-
inputMode === 'csv'
427-
? selectedColumn && csvEmailCount > 0
428-
: pastedEmailCount > 0;
414+
const canMatch = inputMode === 'csv' ? selectedColumn && csvEmailCount > 0 : pastedEmailCount > 0;
429415

430416
return (
431417
<div className="flex w-full flex-col gap-y-6">
@@ -743,9 +729,7 @@ export function KiloclawExtendTrial() {
743729
<TableRow key={user.userId}>
744730
<TableCell className="font-mono text-sm">{user.email}</TableCell>
745731
<TableCell>{user.userName ?? '—'}</TableCell>
746-
<TableCell>
747-
{subscriptionStatusBadge(user.subscriptionStatus)}
748-
</TableCell>
732+
<TableCell>{subscriptionStatusBadge(user.subscriptionStatus)}</TableCell>
749733
<TableCell className="text-muted-foreground font-mono text-xs">
750734
{user.userId}
751735
</TableCell>
@@ -757,7 +741,9 @@ export function KiloclawExtendTrial() {
757741

758742
<Button
759743
onClick={handleExtendTrials}
760-
disabled={extendTrialsMutation.isPending || eligibleCount === 0 || results !== null}
744+
disabled={
745+
extendTrialsMutation.isPending || eligibleCount === 0 || results !== null
746+
}
761747
size="lg"
762748
>
763749
{extendTrialsMutation.isPending ? (
@@ -785,11 +771,7 @@ export function KiloclawExtendTrial() {
785771
{unmatchedEmails.length} email{unmatchedEmails.length !== 1 ? 's' : ''} not
786772
found in the database:
787773
</p>
788-
<Button
789-
variant="outline"
790-
size="sm"
791-
onClick={handleDownloadUnmatched}
792-
>
774+
<Button variant="outline" size="sm" onClick={handleDownloadUnmatched}>
793775
<Download className="mr-1 h-3 w-3" />
794776
Export
795777
</Button>

0 commit comments

Comments
 (0)