1 export const compareCrew = (a, b) => {
2 const a_confirmed = !!(a && a.confirmed);
3 const b_confirmed = !!(b && b.confirmed);
4 if (a_confirmed === b_confirmed) {
5 return getName(a).localeCompare(getName(b));
7 return a_confirmed ? -1 : 1;
10 export const getName = crew => {
12 if (crew.name_override) {
13 return crew.name_override;
16 return crew.user.nickname || crew.user.username;
21 export const getStreamLink = crew => {
22 if (crew.stream_override) {
23 return crew.stream_override;
25 if (crew.user && crew.user.stream_link) {
26 return crew.user.stream_link;