mirror of
https://github.com/cssgunc/compass.git
synced 2025-04-09 14:00:15 -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 ) {
|
||||
const columnHelper = createColumnHelper<Resource>();
|
||||
|
||||
// TODO: Update preset options for resources
|
||||
const { presetOptions, setPresetOptions, getTagColor } = useTagsHandler([
|
||||
"administrator",
|
||||
"volunteer",
|
||||
"employee",
|
||||
const programProps = useTagsHandler([
|
||||
"community",
|
||||
"domestic",
|
||||
"economic",
|
||||
])
|
||||
|
||||
const columns: ColumnDef<Resource, any>[] = [
|
||||
|
@ -67,9 +66,7 @@ export default function ResourceTable({ data, setData }: ResourceTableProps ) {
|
|||
cell: (info) => (
|
||||
<TagsInput
|
||||
presetValue={info.getValue()}
|
||||
presetOptions={presetOptions}
|
||||
setPresetOptions={setPresetOptions}
|
||||
getTagColor={getTagColor}
|
||||
{...programProps}
|
||||
/>
|
||||
),
|
||||
}),
|
||||
|
|
|
@ -20,11 +20,21 @@ type ServiceTableProps = {
|
|||
export default function ServiceTable({ data, setData }: ServiceTableProps ) {
|
||||
const columnHelper = createColumnHelper<Service>();
|
||||
|
||||
// TODO: Update preset options for services
|
||||
const { presetOptions, setPresetOptions, getTagColor } = useTagsHandler([
|
||||
"administrator",
|
||||
"volunteer",
|
||||
"employee",
|
||||
const programProps = useTagsHandler([
|
||||
"community",
|
||||
"domestic",
|
||||
"economic",
|
||||
])
|
||||
|
||||
// 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>[] = [
|
||||
|
@ -61,9 +71,7 @@ export default function ServiceTable({ data, setData }: ServiceTableProps ) {
|
|||
cell: (info) => (
|
||||
<TagsInput
|
||||
presetValue={info.getValue()}
|
||||
presetOptions={presetOptions}
|
||||
setPresetOptions={setPresetOptions}
|
||||
getTagColor={getTagColor}
|
||||
{...programProps}
|
||||
/>
|
||||
),
|
||||
}),
|
||||
|
@ -77,9 +85,7 @@ export default function ServiceTable({ data, setData }: ServiceTableProps ) {
|
|||
// TODO: Setup different tag handler for requirements
|
||||
<TagsInput
|
||||
presetValue={info.getValue()[0] !== "" ? info.getValue() : ["N/A"]}
|
||||
presetOptions={presetOptions}
|
||||
setPresetOptions={setPresetOptions}
|
||||
getTagColor={getTagColor}
|
||||
{...requirementProps}
|
||||
/>
|
||||
),
|
||||
}),
|
||||
|
|
|
@ -19,13 +19,19 @@ type UserTableProps = {
|
|||
*/
|
||||
export default function UserTable({ data, setData }: UserTableProps ) {
|
||||
const columnHelper = createColumnHelper<User>();
|
||||
|
||||
const { presetOptions, setPresetOptions, getTagColor } = useTagsHandler([
|
||||
|
||||
const roleProps = useTagsHandler([
|
||||
"administrator",
|
||||
"volunteer",
|
||||
"employee",
|
||||
])
|
||||
|
||||
|
||||
const programProps = useTagsHandler([
|
||||
"community",
|
||||
"domestic",
|
||||
"economic",
|
||||
])
|
||||
|
||||
const columns: ColumnDef<User, any>[] = [
|
||||
columnHelper.accessor("username", {
|
||||
header: () => (
|
||||
|
@ -51,9 +57,7 @@ export default function UserTable({ data, setData }: UserTableProps ) {
|
|||
cell: (info) => (
|
||||
<TagsInput
|
||||
presetValue={info.getValue()}
|
||||
presetOptions={presetOptions}
|
||||
setPresetOptions={setPresetOptions}
|
||||
getTagColor={getTagColor}
|
||||
{...roleProps}
|
||||
/>
|
||||
),
|
||||
}),
|
||||
|
@ -76,14 +80,11 @@ export default function UserTable({ data, setData }: UserTableProps ) {
|
|||
Program
|
||||
</>
|
||||
),
|
||||
// TODO: Setup different tags handler for program
|
||||
cell: (info) => (
|
||||
<TagsInput
|
||||
presetValue={info.getValue()}
|
||||
presetOptions={presetOptions}
|
||||
setPresetOptions={setPresetOptions}
|
||||
getTagColor={getTagColor}
|
||||
/>
|
||||
presetValue={info.getValue()}
|
||||
{...programProps}
|
||||
/>
|
||||
),
|
||||
}),
|
||||
];
|
||||
|
|
Loading…
Reference in New Issue
Block a user