diff --git a/components/admin/ticket.tsx b/components/admin/ticket.tsx index f87f5f6f..6e47d8ba 100644 --- a/components/admin/ticket.tsx +++ b/components/admin/ticket.tsx @@ -1,7 +1,6 @@ 'use client' import useSWR, {mutate} from "swr"; import { useState } from "react"; -import { initialSelectedOptions } from "../ticketing/pricingDefaults"; import { format, fromUnixTime } from "date-fns"; import Link from "next/link"; import NameChangeModal from './modals/nameChangeModal'; @@ -9,16 +8,9 @@ import TicketTransferModal from './modals/ticketTransferModal'; import { fetcher } from "@lib/fetchers"; import { guaranteeTimestampFromDate } from "@lib/useful"; -const accessToThings = (access:number[],) => { - let products = [] - let index = 0 - Object.keys(initialSelectedOptions).forEach((day) => { - Object.keys(initialSelectedOptions[day]).forEach((pass) => { - if (access[index] === 1) { products.push(`${day} ${pass}`) } - index += 1 - }) - }) - return products +const mapAccessArrayToItems = (accessArray: number[]) => { + const accessOrder = ["Friday Party", "Saturday Classes", "Saturday Dinner", "Saturday Party", "Sunday Classes", "Sunday Party"]; + return accessOrder.map((item, index) => (accessArray[index] === 1 ? item : null)).filter(item => item !== null) } type infoOptions = { @@ -95,8 +87,8 @@ export default function TicketView({ticket_number, email}: {ticket_number: strin