2023-10-15 14:20:55 -07:00
|
|
|
import React from "react";
|
|
|
|
import {
|
2024-09-09 16:10:45 -07:00
|
|
|
Box,
|
|
|
|
Button,
|
|
|
|
Modal,
|
|
|
|
ModalBody,
|
|
|
|
ModalCloseButton,
|
|
|
|
ModalContent,
|
|
|
|
ModalHeader,
|
|
|
|
ModalOverlay,
|
|
|
|
Table,
|
|
|
|
Tbody,
|
|
|
|
Td,
|
|
|
|
Th,
|
|
|
|
Thead,
|
|
|
|
Tr,
|
2023-10-15 14:20:55 -07:00
|
|
|
} from "@chakra-ui/react";
|
|
|
|
|
|
|
|
function LayersInfoModal({ isOpen, onClose, visibleLayers }) {
|
2024-09-09 16:10:45 -07:00
|
|
|
return (
|
|
|
|
<Modal isOpen={isOpen} onClose={onClose} size="xl">
|
|
|
|
<ModalOverlay>
|
|
|
|
<ModalContent maxWidth="800px">
|
|
|
|
<ModalHeader>Outfit layers</ModalHeader>
|
|
|
|
<ModalCloseButton />
|
|
|
|
<ModalBody>
|
|
|
|
<LayerTable layers={visibleLayers} />
|
|
|
|
</ModalBody>
|
|
|
|
</ModalContent>
|
|
|
|
</ModalOverlay>
|
|
|
|
</Modal>
|
|
|
|
);
|
2023-10-15 14:20:55 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function LayerTable({ layers }) {
|
2024-09-09 16:10:45 -07:00
|
|
|
return (
|
|
|
|
<Table>
|
|
|
|
<Thead>
|
|
|
|
<Tr>
|
|
|
|
<Th>Preview</Th>
|
|
|
|
<Th>DTI ID</Th>
|
|
|
|
<Th>Zone</Th>
|
|
|
|
<Th>Links</Th>
|
|
|
|
</Tr>
|
|
|
|
</Thead>
|
|
|
|
<Tbody>
|
|
|
|
{layers.map((layer) => (
|
|
|
|
<LayerTableRow key={layer.id} layer={layer} />
|
|
|
|
))}
|
|
|
|
</Tbody>
|
|
|
|
</Table>
|
|
|
|
);
|
2023-10-15 14:20:55 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
function LayerTableRow({ layer, ...props }) {
|
2024-09-09 16:10:45 -07:00
|
|
|
return (
|
|
|
|
<Tr {...props}>
|
|
|
|
<Td>
|
|
|
|
<Box
|
|
|
|
as="img"
|
|
|
|
src={layer.imageUrl}
|
|
|
|
width="60px"
|
|
|
|
height="60px"
|
|
|
|
boxShadow="md"
|
|
|
|
/>
|
|
|
|
</Td>
|
|
|
|
<Td>{layer.id}</Td>
|
|
|
|
<Td>{layer.zone.label}</Td>
|
|
|
|
<Td>
|
|
|
|
<Box display="flex" gap=".5em">
|
|
|
|
{layer.imageUrl && (
|
|
|
|
<Button as="a" href={layer.imageUrl} target="_blank" size="sm">
|
|
|
|
PNG
|
|
|
|
</Button>
|
|
|
|
)}
|
|
|
|
{layer.swfUrl && (
|
|
|
|
<Button as="a" href={layer.swfUrl} size="sm" download>
|
|
|
|
SWF
|
|
|
|
</Button>
|
|
|
|
)}
|
|
|
|
{layer.svgUrl && (
|
|
|
|
<Button as="a" href={layer.svgUrl} target="_blank" size="sm">
|
|
|
|
SVG
|
|
|
|
</Button>
|
|
|
|
)}
|
|
|
|
</Box>
|
|
|
|
</Td>
|
|
|
|
</Tr>
|
|
|
|
);
|
2023-10-15 14:20:55 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
export default LayersInfoModal;
|