'auto'}
+ pageSizeOptions={[15]}
slots={{
footer: Footer
}}
@@ -130,6 +146,47 @@ function CharacterList() {
);
}
+function RaidStatusWrapper(props: any) {
+ return (
+ Error}>
+
+
+ )
+}
+
+function RaidStatus(props: {value: any}) {
+ if(!props.value) {
+ return "";
+ }
+
+ return (
+
+ {props.value.map((instance: any) => )}
+
+ );
+}
+
+function InstanceStatus(props: {instance: any, modes: any}) {
+ return (
+
+ {RAID_ABBREVIATIONS[props.instance.id] || props.instance.name}: {props.modes.map((mode: any) => )}
+
+ )
+}
+
+function ModeStatus(props: any) {
+ const routeParams = useParams() as {region: string};
+ const region = routeParams.region.toUpperCase();
+
+ const name = DIFFUCULTY_ABBREVIATIONS[props.difficulty.type] || props.difficulty.name;
+ const killsThisWeek = props.progress.encounters.filter((encounter: any) => DateTime.fromMillis(encounter.last_kill_timestamp) > WEEKLY_RESET[region]).length;
+
+ //Variant is either none, partial or full
+ const variant = killsThisWeek === props.progress.total_count ? 'full' : killsThisWeek > 0 ? 'partial' : 'none';
+
+ return {`${killsThisWeek}/${props.progress.total_count} ${name}`} ;
+}
+
function Footer() {
const {region} = useParams();
const navigate = useNavigate();
diff --git a/frontend/character-list/src/constants.tsx b/frontend/character-list/src/constants.tsx
new file mode 100644
index 0000000..61ad1cd
--- /dev/null
+++ b/frontend/character-list/src/constants.tsx
@@ -0,0 +1,28 @@
+import {DateTime} from "luxon";
+
+export const REGIONS = ['eu', 'us', 'kr', 'tw']
+export const RAID_ABBREVIATIONS: {[key: number]: string} = {
+ 1200: 'VOTI',
+ 1208: 'ATSC',
+ 1207: 'ATDH',
+}
+
+export const DIFFUCULTY_ABBREVIATIONS: {[key: string]: string} = {
+ 'LFR': 'LFR',
+ 'NORMAL': 'NHC',
+ 'HEROIC': 'HC',
+ 'MYTHIC': 'M',
+}
+
+export const WEEKLY_RESET: {[key: string]: DateTime} = {
+ "EU": DateTime.utc().startOf('week').set({ weekday: 3, hour: 4, minute: 0, second: 0, millisecond: 0 }),
+ "US": DateTime.utc().startOf('week').set({ weekday: 2, hour: 15, minute: 0, second: 0, millisecond: 0 }),
+ "KR": DateTime.utc().startOf('week').set({ weekday: 3, hour: 22, minute: 0, second: 0, millisecond: 0 }),
+ "TW": DateTime.utc().startOf('week').set({ weekday: 3, hour: 22, minute: 0, second: 0, millisecond: 0 }),
+}
+
+for (const REGION in WEEKLY_RESET) {
+ if(DateTime.utc() < WEEKLY_RESET[REGION]) {
+ WEEKLY_RESET[REGION] = WEEKLY_RESET[REGION].minus({weeks: 1});
+ }
+}
\ No newline at end of file