import { gql, useQuery } from "@apollo/client";
import { useColorModeValue } from "@chakra-ui/color-mode";
import { QuestionIcon } from "@chakra-ui/icons";
import { Box, Flex, Wrap, WrapItem } from "@chakra-ui/layout";
import {
Popover,
PopoverArrow,
PopoverBody,
PopoverContent,
PopoverTrigger,
} from "@chakra-ui/popover";
import HangerSpinner from "./components/HangerSpinner";
import { ErrorMessage, Heading1 } from "./util";
import useSupport from "./WardrobePage/support/useSupport";
import Link from "next/link";
function SupportPetAppearancesPage() {
const { isSupportUser } = useSupport();
if (!isSupportUser) {
return Sorry, this page is only for Support users!;
}
return (
Support: Pet appearances
These species/color combinations have some UNKNOWN{" "}
appearances that need labeled! Please take a look!
This includes species/color combinations that have at least one{" "}
non-glitched UNKNOWN pose, and still need a
non-glitched version of at least one of the standard 6
mood/gender-presentation poses. Sorted newest to oldest.
);
}
function UnlabeledPetAppearancesList() {
const { loading, error, data } = useQuery(gql`
query SupportUnlabeledSpeciesColorPairs {
speciesColorPairsThatNeedSupportLabeling {
id
species {
id
name
}
color {
id
name
}
}
}
`);
if (loading) {
return (
);
}
if (error) {
return {error.message};
}
// Sort the pairs from newest to oldest, taking advantage of our knowledge
// that the IDs are numbers that increase over time. (A bit hacky, a real
// timestamp would be better, but we never stored those oops!)
const speciesColorPairs = [
...data.speciesColorPairsThatNeedSupportLabeling,
].sort((a, b) => Number(b.id) - Number(a.id));
if (speciesColorPairs.length === 0) {
return <>…never mind, they're all done! Wow, go team!! 🎉>;
}
return (
{speciesColorPairs.map(({ id, species, color }) => (
))}
{speciesColorPairs.length >= 10 && (
(That's {speciesColorPairs.length} total, and fewer by the minute!)
)}
);
}
function SpeciesColorEditorLink({ species, color }) {
const hoverBackgroundColor = useColorModeValue(
"blackAlpha.50",
"whiteAlpha.100"
);
return (
{color.name} {species.name}
);
}
export default SupportPetAppearancesPage;