[resource page][m]: initially working resource page with support of datastore and non-datastore resources.
This commit is contained in:
38
components/resource/About.tsx
Normal file
38
components/resource/About.tsx
Normal 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>
|
||||
</>
|
||||
)
|
||||
}
|
||||
9
components/resource/DataExplorer.tsx
Normal file
9
components/resource/DataExplorer.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import Link from 'next/link'
|
||||
|
||||
export default function DataExplorer({ resource }) {
|
||||
return (
|
||||
<>
|
||||
{JSON.stringify(resource, null, 2)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
9
components/resource/DataView.tsx
Normal file
9
components/resource/DataView.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
import Link from 'next/link'
|
||||
|
||||
export default function DataView({ resource }) {
|
||||
return (
|
||||
<>
|
||||
{JSON.stringify(resource, null, 2)}
|
||||
</>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user