mirror of
https://github.com/cssgunc/compass.git
synced 2025-04-20 18:40:17 -04:00
updated tags for all tables
This commit is contained in:
parent
70a618c7c9
commit
36b3f5802b
|
@ -20,11 +20,10 @@ type ResourceTableProps = {
|
||||||
export default function ResourceTable({ data, setData }: ResourceTableProps ) {
|
export default function ResourceTable({ data, setData }: ResourceTableProps ) {
|
||||||
const columnHelper = createColumnHelper<Resource>();
|
const columnHelper = createColumnHelper<Resource>();
|
||||||
|
|
||||||
// TODO: Update preset options for resources
|
const programProps = useTagsHandler([
|
||||||
const { presetOptions, setPresetOptions, getTagColor } = useTagsHandler([
|
"community",
|
||||||
"administrator",
|
"domestic",
|
||||||
"volunteer",
|
"economic",
|
||||||
"employee",
|
|
||||||
])
|
])
|
||||||
|
|
||||||
const columns: ColumnDef<Resource, any>[] = [
|
const columns: ColumnDef<Resource, any>[] = [
|
||||||
|
@ -67,9 +66,7 @@ export default function ResourceTable({ data, setData }: ResourceTableProps ) {
|
||||||
cell: (info) => (
|
cell: (info) => (
|
||||||
<TagsInput
|
<TagsInput
|
||||||
presetValue={info.getValue()}
|
presetValue={info.getValue()}
|
||||||
presetOptions={presetOptions}
|
{...programProps}
|
||||||
setPresetOptions={setPresetOptions}
|
|
||||||
getTagColor={getTagColor}
|
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -20,11 +20,21 @@ type ServiceTableProps = {
|
||||||
export default function ServiceTable({ data, setData }: ServiceTableProps ) {
|
export default function ServiceTable({ data, setData }: ServiceTableProps ) {
|
||||||
const columnHelper = createColumnHelper<Service>();
|
const columnHelper = createColumnHelper<Service>();
|
||||||
|
|
||||||
// TODO: Update preset options for services
|
const programProps = useTagsHandler([
|
||||||
const { presetOptions, setPresetOptions, getTagColor } = useTagsHandler([
|
"community",
|
||||||
"administrator",
|
"domestic",
|
||||||
"volunteer",
|
"economic",
|
||||||
"employee",
|
])
|
||||||
|
|
||||||
|
// TODO: Dynamically or statically get full list of preset requirement tag options
|
||||||
|
const requirementProps = useTagsHandler([
|
||||||
|
'anonymous',
|
||||||
|
'confidential',
|
||||||
|
'referral required',
|
||||||
|
'safety assessment',
|
||||||
|
'intake required',
|
||||||
|
'income eligibility',
|
||||||
|
'initial assessment',
|
||||||
])
|
])
|
||||||
|
|
||||||
const columns: ColumnDef<Service, any>[] = [
|
const columns: ColumnDef<Service, any>[] = [
|
||||||
|
@ -61,9 +71,7 @@ export default function ServiceTable({ data, setData }: ServiceTableProps ) {
|
||||||
cell: (info) => (
|
cell: (info) => (
|
||||||
<TagsInput
|
<TagsInput
|
||||||
presetValue={info.getValue()}
|
presetValue={info.getValue()}
|
||||||
presetOptions={presetOptions}
|
{...programProps}
|
||||||
setPresetOptions={setPresetOptions}
|
|
||||||
getTagColor={getTagColor}
|
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
}),
|
}),
|
||||||
|
@ -77,9 +85,7 @@ export default function ServiceTable({ data, setData }: ServiceTableProps ) {
|
||||||
// TODO: Setup different tag handler for requirements
|
// TODO: Setup different tag handler for requirements
|
||||||
<TagsInput
|
<TagsInput
|
||||||
presetValue={info.getValue()[0] !== "" ? info.getValue() : ["N/A"]}
|
presetValue={info.getValue()[0] !== "" ? info.getValue() : ["N/A"]}
|
||||||
presetOptions={presetOptions}
|
{...requirementProps}
|
||||||
setPresetOptions={setPresetOptions}
|
|
||||||
getTagColor={getTagColor}
|
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
}),
|
}),
|
||||||
|
|
|
@ -20,12 +20,18 @@ type UserTableProps = {
|
||||||
export default function UserTable({ data, setData }: UserTableProps ) {
|
export default function UserTable({ data, setData }: UserTableProps ) {
|
||||||
const columnHelper = createColumnHelper<User>();
|
const columnHelper = createColumnHelper<User>();
|
||||||
|
|
||||||
const { presetOptions, setPresetOptions, getTagColor } = useTagsHandler([
|
const roleProps = useTagsHandler([
|
||||||
"administrator",
|
"administrator",
|
||||||
"volunteer",
|
"volunteer",
|
||||||
"employee",
|
"employee",
|
||||||
])
|
])
|
||||||
|
|
||||||
|
const programProps = useTagsHandler([
|
||||||
|
"community",
|
||||||
|
"domestic",
|
||||||
|
"economic",
|
||||||
|
])
|
||||||
|
|
||||||
const columns: ColumnDef<User, any>[] = [
|
const columns: ColumnDef<User, any>[] = [
|
||||||
columnHelper.accessor("username", {
|
columnHelper.accessor("username", {
|
||||||
header: () => (
|
header: () => (
|
||||||
|
@ -51,9 +57,7 @@ export default function UserTable({ data, setData }: UserTableProps ) {
|
||||||
cell: (info) => (
|
cell: (info) => (
|
||||||
<TagsInput
|
<TagsInput
|
||||||
presetValue={info.getValue()}
|
presetValue={info.getValue()}
|
||||||
presetOptions={presetOptions}
|
{...roleProps}
|
||||||
setPresetOptions={setPresetOptions}
|
|
||||||
getTagColor={getTagColor}
|
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
}),
|
}),
|
||||||
|
@ -76,13 +80,10 @@ export default function UserTable({ data, setData }: UserTableProps ) {
|
||||||
Program
|
Program
|
||||||
</>
|
</>
|
||||||
),
|
),
|
||||||
// TODO: Setup different tags handler for program
|
|
||||||
cell: (info) => (
|
cell: (info) => (
|
||||||
<TagsInput
|
<TagsInput
|
||||||
presetValue={info.getValue()}
|
presetValue={info.getValue()}
|
||||||
presetOptions={presetOptions}
|
{...programProps}
|
||||||
setPresetOptions={setPresetOptions}
|
|
||||||
getTagColor={getTagColor}
|
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
}),
|
}),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user