Move card types to declaration file
This commit is contained in:
parent
9a5820cfba
commit
b6f073083e
@ -9,6 +9,7 @@ import {
|
|||||||
} from "@chakra-ui/react";
|
} from "@chakra-ui/react";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import AppealCard from "../../components/AppealCard.js";
|
import AppealCard from "../../components/AppealCard.js";
|
||||||
|
import ReportCard from "../../components/ReportCard.js";
|
||||||
import { useLoaderData } from "@remix-run/react";
|
import { useLoaderData } from "@remix-run/react";
|
||||||
|
|
||||||
export async function loader({ context }: { context: RequestContext }) {
|
export async function loader({ context }: { context: RequestContext }) {
|
||||||
@ -114,19 +115,12 @@ export default function () {
|
|||||||
for (const entry of entryData) {
|
for (const entry of entryData) {
|
||||||
switch (queue_type) {
|
switch (queue_type) {
|
||||||
case "appeal":
|
case "appeal":
|
||||||
newEntries.push(
|
newEntries.push(<AppealCard {...(entry as AppealCardProps)} />);
|
||||||
<AppealCard
|
|
||||||
{...(entry as {
|
break;
|
||||||
ban_reason: string;
|
|
||||||
createdAt: number;
|
case "report":
|
||||||
discriminator: string;
|
newEntries.push(<ReportCard {...(entry as ReportCardProps)} />);
|
||||||
id: string;
|
|
||||||
learned: string;
|
|
||||||
reason_for_unban: string;
|
|
||||||
username: string;
|
|
||||||
})}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,15 +12,7 @@ import {
|
|||||||
} from "@chakra-ui/react";
|
} from "@chakra-ui/react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
export default function (props: {
|
export default function (props: AppealCardProps) {
|
||||||
ban_reason: string;
|
|
||||||
createdAt: number;
|
|
||||||
discriminator: string;
|
|
||||||
id: string;
|
|
||||||
learned: string;
|
|
||||||
reason_for_unban: string;
|
|
||||||
username: string;
|
|
||||||
}) {
|
|
||||||
const [dateString, setDateString] = useState(
|
const [dateString, setDateString] = useState(
|
||||||
new Date(props.createdAt).toUTCString()
|
new Date(props.createdAt).toUTCString()
|
||||||
);
|
);
|
||||||
|
@ -13,13 +13,7 @@ import {
|
|||||||
} from "@chakra-ui/react";
|
} from "@chakra-ui/react";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
export default function (props: {
|
export default function (props: ReportCardProps) {
|
||||||
attachment: string;
|
|
||||||
attachment_loading?: boolean;
|
|
||||||
reporter?: { [k: string]: any };
|
|
||||||
target_ids: number[];
|
|
||||||
target_usernames: string[];
|
|
||||||
}) {
|
|
||||||
const targetMap: { [k: number]: string } = {};
|
const targetMap: { [k: number]: string } = {};
|
||||||
const [attachmentReady, setAttachmentReady] = useState(
|
const [attachmentReady, setAttachmentReady] = useState(
|
||||||
!props.attachment_loading
|
!props.attachment_loading
|
||||||
|
18
index.d.ts
vendored
18
index.d.ts
vendored
@ -23,6 +23,24 @@ declare global {
|
|||||||
extractCriticalToChunks: (html: string) => EmotionCriticalToChunks;
|
extractCriticalToChunks: (html: string) => EmotionCriticalToChunks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface AppealCardProps {
|
||||||
|
ban_reason: string;
|
||||||
|
createdAt: number;
|
||||||
|
discriminator: string;
|
||||||
|
id: string;
|
||||||
|
learned: string;
|
||||||
|
reason_for_unban: string;
|
||||||
|
username: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ReportCardProps {
|
||||||
|
attachment: string;
|
||||||
|
attachment_loading?: boolean;
|
||||||
|
reporter?: { [k: string]: any };
|
||||||
|
target_ids: number[];
|
||||||
|
target_usernames: string[];
|
||||||
|
}
|
||||||
|
|
||||||
export function createEmotionServer(cache: EmotionCache): EmotionServer;
|
export function createEmotionServer(cache: EmotionCache): EmotionServer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user