File size: 2,082 Bytes
f55c62a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import { Tabs, Tab } from 'fumadocs-ui/components/tabs';
import { instances } from '@/lib/instances';
import { Callout } from 'fumadocs-ui/components/callout';

export function InstanceTabs() {
  return (
    <Tabs items={instances.map((i) => i.name)}>
      {instances.map((instance) => {
        const link = (base: string) => `${base}/stremio/configure`;
        const label = (base: string) => base.replace('https://', '');

        return (
          <Tab key={instance.id} value={instance.name}>
            <h3 className="mt-0 flex items-center gap-2">
              {instance.name} AIOStreams
            </h3>

            {instance.hostedBy && (
              <p>
                Hosted by{' '}
                {instance.hostedByUrl ? (
                  <a href={instance.hostedByUrl}>{instance.hostedBy}</a>
                ) : (
                  instance.hostedBy
                )}
                .
              </p>
            )}

            {instance.description && <p>{instance.description}</p>}

            {instance.warning && (
              <Callout type="warning">{instance.warning}</Callout>
            )}

            <table>
              <thead>
                <tr>
                  <th>Channel</th>
                  <th>URL</th>
                </tr>
              </thead>
              <tbody>
                {instance.stable && (
                  <tr>
                    <td>Stable</td>
                    <td>
                      <a href={link(instance.stable)}>
                        {label(instance.stable)}
                      </a>
                    </td>
                  </tr>
                )}
                {instance.nightly && (
                  <tr>
                    <td>Nightly</td>
                    <td>
                      <a href={link(instance.nightly)}>
                        {label(instance.nightly)}
                      </a>
                    </td>
                  </tr>
                )}
              </tbody>
            </table>
          </Tab>
        );
      })}
    </Tabs>
  );
}