[resource page][m]: initially working resource page with support of datastore and non-datastore resources.

This commit is contained in:
anuveyatsu
2020-06-15 15:53:12 +06:00
parent bc6849b7dc
commit bb22cac696
7 changed files with 402 additions and 10 deletions

View File

@@ -0,0 +1,38 @@
import Link from 'next/link'
export default function About({ resource }) {
return (
<>
<table className="table-auto w-full text-sm text-left my-6">
<thead>
<tr>
<th className="px-4 py-2">Name</th>
<th className="px-4 py-2">Title</th>
<th className="px-4 py-2">Description</th>
<th className="px-4 py-2">Format</th>
<th className="px-4 py-2">Size</th>
<th className="px-4 py-2">Created</th>
<th className="px-4 py-2">Updated</th>
<th className="px-4 py-2">Download</th>
</tr>
</thead>
<tbody>
<tr>
<td className="px-4 py-2">{ resource.name || resource.id }</td>
<td className="px-4 py-2">{ resource.title || '' }</td>
<td className="px-4 py-2">{ resource.description || '' }</td>
<td className="px-4 py-2">{ resource.format }</td>
<td className="px-4 py-2">{ resource.size }</td>
<td className="px-4 py-2">{ resource.created }</td>
<td className="px-4 py-2">{ resource.last_modified || '' }</td>
<td className="px-4 py-2">
<Link href={resource.path}>
<a className="bg-white hover:bg-gray-200 border text-black font-semibold py-2 px-4 rounded">{ resource.format }</a>
</Link>
</td>
</tr>
</tbody>
</table>
</>
)
}

View File

@@ -0,0 +1,9 @@
import Link from 'next/link'
export default function DataExplorer({ resource }) {
return (
<>
{JSON.stringify(resource, null, 2)}
</>
)
}

View File

@@ -0,0 +1,9 @@
import Link from 'next/link'
export default function DataView({ resource }) {
return (
<>
{JSON.stringify(resource, null, 2)}
</>
)
}